HuCaoFighting / Swin-Unet

[ECCVW 2022] The codes for the work "Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation"
1.77k stars 320 forks source link

einops.rearrange 替换问题 #79

Open lindadamama opened 1 year ago

lindadamama commented 1 year ago

I want to translate this network with torchsharp
in class PatchExpand 语言用C#

   x = x.view(B, H, W, C);
   x1 = x.reshape(B,H*2,W*2,C/4);
   x2= rearrange(x, 'b h w (p1 p2 c)-> b (h p1) (w p2) c', p1 : 2, p2 : 2, c : C / 4)

Can x1 replace x2? Or there are other options?

lindadamama commented 1 year ago

是不是和patchEmbeding等价?