U Ph @sddlmZddlZddlmZddlZddlZddlm Z ddl m m Z ddl mmZddlmZddlmZddlmZddlmZmZmZmZddlmZmZdd lmZmZm Z dd l!m"Z"e d d d \Z#Z$ddddddddddg Z%Gddde j&Z'ddZ(ddZ)d(ddZ*Gddde j&Z+Gddde j&Z,Gddde j&Z-Gd dde-Z.e.e-d!Z/d"d#Z0Gd$dde j&Z1Gd%dde j&Z2d&d'Z3dS))) annotationsN)Sequence) LayerNorm)Final)MLPBlock) PatchEmbed UnetOutBlockUnetrBasicBlock UnetrUpBlock)DropPath trunc_normal_)ensure_tuple_replook_up_optionoptional_import)deprecated_argeinops rearrange)name SwinUNETRwindow_partitionwindow_reverseWindowAttentionSwinTransformerBlock PatchMergingPatchMergingV2 MERGING_MODE BasicLayerSwinTransformercseZdZUdZdZded<eddddd d#dddddddddddddddfdd ZddZe j j dd Z d!d"Z ZS)$rz Swin UNETR based on: "Hatamizadeh et al., Swin UNETR: Swin Transformers for Semantic Segmentation of Brain Tumors in MRI Images " z Final[int] patch_sizeimg_sizez1.3z1.5zdThe img_size argument is not required anymore and checks on the input size are run during forward().)rsinceremoved msg_suffixrrrr r)instanceTFr&mergingzSequence[int] | intint Sequence[int]z tuple | strfloatboolNone)r in_channels out_channelsdepths num_heads feature_size norm_name drop_rateattn_drop_ratedropout_path_rate normalizeuse_checkpoint spatial_dimsreturncs0tt|| }t|j| }td| }| dkr:td||d|krXdksbntdd| krvdksntdd| krdksntd|d dkrtd | |_t||||||d d || | tj | | t |t rt |t n||d |_t| ||dd|d d|_t| ||dd|d d|_t| d|d|dd|d d|_t| d|d|dd|d d|_t| d|d|dd|d d|_t| d|d|dd|d d|_t| |d|ddd|d d|_t| |d|ddd|d d|_t| |d|dd|d d|_t| ||dd|d d|_t| ||d|_dS)a Args: img_size: spatial dimension of input image. This argument is only used for checking that the input image size is divisible by the patch size. The tensor passed to forward() can have a dynamic shape as long as its spatial dimensions are divisible by 2**5. It will be removed in an upcoming version. in_channels: dimension of input channels. out_channels: dimension of output channels. feature_size: dimension of network feature size. depths: number of layers in each stage. num_heads: number of attention heads. norm_name: feature normalization type and arguments. drop_rate: dropout rate. attn_drop_rate: attention dropout rate. dropout_path_rate: drop path rate. normalize: normalize output intermediate features in each stage. use_checkpoint: use gradient checkpointing for reduced memory usage. spatial_dims: number of spatial dims. downsample: module used for downsampling, available options are `"mergingv2"`, `"merging"` and a user-specified `nn.Module` following the API defined in :py:class:`monai.networks.nets.PatchMerging`. The default is currently `"merging"` (the original version defined in v0.9.0). use_v2: using swinunetr_v2, which adds a residual convolution block at the beggining of each swin stage. Examples:: # for 3D single channel input with size (96,96,96), 4-channel output and feature size of 48. >>> net = SwinUNETR(img_size=(96,96,96), in_channels=1, out_channels=4, feature_size=48) # for 3D 4-channel input with size (128,128,128), 3-channel output and (2,4,2,2) layers in each stage. >>> net = SwinUNETR(img_size=(128,128,128), in_channels=4, out_channels=3, depths=(2,4,2,2)) # for 2D single channel input with size (96,96), 2-channel output and gradient checkpointing. >>> net = SwinUNETR(img_size=(96,96), in_channels=3, out_channels=2, use_checkpoint=True, spatial_dims=2) )rr&z#spatial dimension should be 2 or 3.rz'dropout rate should be between 0 and 1.z1attention dropout rate should be between 0 and 1.z)drop path rate should be between 0 and 1.r(z'feature_size should be divisible by 12.@T)in_chans embed_dim window_sizerr4r5 mlp_ratioqkv_biasr8r9drop_path_rate norm_layerr<r= downsampleuse_v2r&r=r2r3 kernel_sizestrider7 res_blockr)r=r2r3rLupsample_kernel_sizer7rN)r=r2r3N)super__init__r r ValueError_check_input_sizer;rnnr isinstancestrrrswinViTr encoder1encoder2encoder3encoder4 encoder10r decoder5decoder4decoder3decoder2decoder1rout)selfr r2r3r4r5r6r7r8r9r:r;r<r=rIrJZ patch_sizesrD __class__S/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/networks/nets/swin_unetr.pyrT8s=                zSwinUNETR.__init__c Cstn|jjjj|dd|jjjj|dd|jjdj D]\}}|j ||ddqR|jjdj j j|dd|jjdj jj|dd|jjdj jj|dd |jjdj D]\}}|j ||d dq|jjdj j j|dd |jjdj jj|dd |jjdj jj|dd |jjdj D]\}}|j ||ddqj|jjdj j j|dd|jjdj jj|dd|jjdj jj|dd|jjdj D]\}}|j ||ddq|jjdj j j|dd|jjdj jj|dd|jjdj jj|ddW5QRXdS)N state_dictzmodule.patch_embed.proj.weightzmodule.patch_embed.proj.biasrlayers1)n_blocklayerz,module.layers1.0.downsample.reduction.weightz'module.layers1.0.downsample.norm.weightz%module.layers1.0.downsample.norm.biaslayers2z,module.layers2.0.downsample.reduction.weightz'module.layers2.0.downsample.norm.weightz%module.layers2.0.downsample.norm.biaslayers3z,module.layers3.0.downsample.reduction.weightz'module.layers3.0.downsample.norm.weightz%module.layers3.0.downsample.norm.biaslayers4z,module.layers4.0.downsample.reduction.weightz'module.layers4.0.downsample.norm.weightz%module.layers4.0.downsample.norm.bias)torchno_gradrZ patch_embedprojweightcopy_biasrlblocksnamed_children load_fromrI reductionnormrorprq)rfweightsZbnameblockririrjr{s^             zSwinUNETR.load_fromcCs`t|}|t|jddk}|r\t|dd}td|d|d|jddS)Nrrzspatial dimensions z of input image (spatial shape: z) must be divisible by z**5.)nparraypowerranywheretolistrU)rf spatial_shaper remainderZ wrong_dimsririrjrV7s zSwinUNETR._check_input_sizecCstjs||jdd|||j}||}||d}| |d}| |d}| |d}| ||d}| ||} || |} || |} || |} || } | S)Nrrr@rOr&)rrjit is_scriptingrVshaperZr;r[r\r]r^r_r`rarbrcrdre)rfx_inZhidden_states_outZenc0Zenc1Zenc2Zenc3Zdec4dec3dec2dec1dec0relogitsririrjforwardBs       zSwinUNETR.forward) r$r%r)r*r+r+r+TFr&r,F)__name__ __module__ __qualname____doc__r__annotations__rrTr{rrrunusedrVr __classcell__ririrgrjr/s4   0H1 c Cs|}t|dkr|\}}}}}||||d|d||d|d||d|d|}|ddddddddd |d|d|d|}nvt|dkr|j\}}}}||||d|d||d|d|}|ddddddd |d|d|}|S) a)window partition operation based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer Args: x: input tensor. window_size: local window size. rrr@rr&rOr'r?)sizelenviewpermute contiguousr) xrDx_shapebdhwcwindowsririrjrTs(      8,.c Cst|dkr|\}}}}||||d||d||d|d|d|dd}|dddddddd ||||d}nft|dkr|\}}}||||d||d|d|dd}|dddddd|||d}|S) aOwindow reverse operation based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer Args: windows: windows tensor. window_size: local window size. dims: dimension values. rOrr@rrrr&r'r?)rrrr)rrDdimsrrrrrririrjrus$      ,  ,$cCszt|}|dk rt|}tt|D]0}||||kr$||||<|dk r$d||<q$|dkrft|St|t|fSdS)aQComputing window size based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer Args: x_size: input size. window_size: local window size. shift_size: window shifting size. Nr)listrangertuple)x_sizerD shift_sizeZuse_window_sizeZuse_shift_sizeiririrjget_window_sizes   rc s<eZdZdZddddddddd fd d Zd d ZZS)ra Window based multi-head self attention module with relative position bias based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer Fr+r-r.r0r/r1)dimr5rDrF attn_drop proj_dropr>cst||_||_||_||}|d|_tjj}t |jdkr"t t d|jddd|jddd|jdd||_ t|jd} t|jd} t|jd} |dk rttj| | | dd} ntt| | | } t| d} | dddddf| dddddf}|ddd}|dddddf|jdd7<|dddddf|jdd7<|dddddf|jdd7<|dddddfd|jddd|jdd9<|dddddfd|jdd9<nZt |jdkr|t t d|ddd|dd||_ t|jd} t|jd} |dk rttj| | dd} ntt| | } t| d} | dddddf| dddddf}|ddd}|dddddf|jdd7<|dddddf|jdd7<|dddddfd|jdd9<|d }|d |t j||d|d |_t ||_t |||_t ||_t|j d d t jd d|_dS)aA Args: dim: number of feature channels. num_heads: number of attention heads. window_size: local window size. qkv_bias: add a learnable bias to query, key, value. attn_drop: attention dropout rate. proj_drop: dropout rate of output. gr&rrr@Nij)indexingrrelative_position_indexrxg{Gz?)std)r)rSrTrrDr5scalerrmeshgrid__kwdefaults__rrW Parameterzerosrelative_position_bias_tablearangestackflattenrrsumregister_bufferLinearqkvDropoutrrurr Softmaxsoftmax)rfrr5rDrFrrhead_dimZ mesh_argsZcoords_dcoords_hcoords_wcoordscoords_flattenrelative_coordsrrgrirjrTsf  4 ,(((>0&  ,((,    zWindowAttention.__init__c Csh|j\}}}||||d|j||jddddd}|d|d|d}}} ||j}||dd} |j|j d|d|fd||d} | ddd } | | d} |dk r|jd} | || | |j||| d d} | d|j||} | | } n | | } || | j} | | dd|||}||}||}|S)Nr&rrr@rOr)rrreshaper5rr transposerrcloner unsqueezerrrtodtyperur) rfrmaskrnrrqkvattnrelative_position_biasnwririrjrs2 .   (    zWindowAttention.forward)Fr+r+)rrrrrTrrririrgrjrs   KcsreZdZdZddddddejdfddddd d d d d d d d d d fdd ZddZddZddZ ddZ Z S)rz Swin Transformer block based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer rATr+GELUFr-r.r/r0rYtype[LayerNorm]r1) rr5rDrrErFdropr drop_path act_layerrHr<r>c st||_||_||_||_||_| |_| ||_t ||j||||d|_ | dkr`t | nt |_| ||_t||} t|| | |dd|_dS)as Args: dim: number of feature channels. num_heads: number of attention heads. window_size: local window size. shift_size: window shift size. mlp_ratio: ratio of mlp hidden dim to embedding dim. qkv_bias: add a learnable bias to query, key, value. drop: dropout rate. attn_drop: attention dropout rate. drop_path: stochastic depth rate. act_layer: activation layer. norm_layer: normalization layer. use_checkpoint: use gradient checkpointing for reduced memory usage. )rDr5rFrrr+swin) hidden_sizemlp_dimact dropout_rate dropout_modeN)rSrTrr5rDrrEr<norm1rrr rWIdentityrnorm2r-Mlpmlp)rfrr5rDrrErFrrrrrHr<Zmlp_hidden_dimrgrirjrT%s(     zSwinTransformerBlock.__init__c Cs^|}||}t|dkr|j\}}}}}t|||f|j|j\} } d} } } | d|| d| d}| d|| d| d}| d|| d| d}t|dd| || || |f}|j\}}}}}||||g}nt|dkr|j\}}}}t||f|j|j\} } d} } | d|| d| d}| d|| d| d}t|dd| || |f}|j\}}}}|||g}t dd| Drt|dkrt j || d | d | d fdd }n.t|dkrt j || d | d fd d }|}n|}d}t || }|j ||d }|jd| |f}t|| |}t d d| Drt|dkrt j || d| d| dfdd }n*t|dkrt j || d| dfd d }n|}t|dkr|dks|dks|dkrZ|ddd|d|d|ddf}nFt|dkrZ|dks6|dkrZ|ddd|d|ddf}|S)Nrrr@rrOcss|]}|dkVqdSrNri.0rririrj rsz5SwinTransformerBlock.forward_part1..)r@rr&)shiftsr)r@r)rrcss|]}|dkVqdSrrirririrjrs)r)rrrrrrDrFpadrrrrollrrrrr)rfr mask_matrixrrrrrrrDrpad_lpad_tZpad_d0Zpad_d1pad_bpad_r_dphpwprZ shifted_x attn_maskZ x_windowsZ attn_windowsririrj forward_part1Zs\    *   $,$z"SwinTransformerBlock.forward_part1cCs||||S)N)rrr)rfrririrj forward_part2sz"SwinTransformerBlock.forward_part2cCsd|d|d}dddddd d d d d ddddg}t|jj|d||d|jj|d||d|jj|d||d|jj|d||d|jj j|d||d|jj j|d||d|jj j|d||d|jj j|d||d|j j|d||d|j j|d||d|j j j|d||d|j j j|d||d|j jj|d||d|j jj|d||d W5QRXdS)!Nzmodule.z .0.blocks..z norm1.weightz norm1.biasz!attn.relative_position_bias_tablezattn.relative_position_indexzattn.qkv.weightz attn.qkv.biaszattn.proj.weightzattn.proj.biasz norm2.weightz norm2.biaszmlp.fc1.weightz mlp.fc1.biaszmlp.fc2.weightz mlp.fc2.biasrkrr@rr&rOrr'r?rQ r( )rrrsrrvrwrxrrrrrurrlinear1linear2)rfr~rmrnrootZ block_namesririrjr{s>        zSwinTransformerBlock.load_fromcCsj|}|jr tj|j||dd}n |||}|||}|jrX|tj|j|dd}n|||}|S)NF) use_reentrant)r< checkpointrrr)rfrrshortcutririrjrs zSwinTransformerBlock.forward) rrrrrWrrTrrr{rrririrgrjrs ,56"cs<eZdZdZejdfdddddfdd Zd d ZZS) rz Patch merging layer based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer r&r-rr1)rrHr=r>csvt||_|dkrBtjd|d|dd|_|d||_n0|dkrrtjd|d|dd|_|d||_dS)z Args: dim: number of feature channels. norm_layer: normalization layer. spatial_dims: number of spatial dims. r&rQrFrrON)rSrTrrWrr|r})rfrrHr=rgrirjrTs zPatchMergingV2.__init__c s<}t|dkr|\}}}}}|ddkpD|ddkpD|ddk}|rrtddd|dd|dd|dftfddttdtdtdDdnt|dkr$|\}}}}|ddkp|ddk}|rtddd|dd|dftfd dttdtdDd| | S) Nrrr@rc s>g|]6\}}}dd|dd|dd|ddddfqSNrri)rrjrrrirj sz*PatchMergingV2.forward..rrOcs4g|],\}}dd|dd|ddddfqSr ri)rrr rrirjrs) rrrrrrcat itertoolsproductrr}r|) rfrrrrrrr pad_inputrirrjrs& $(&  *  zPatchMergingV2.forward rrrrrWrrTrrririrgrjrs cs eZdZdZfddZZS)rz7The `PatchMerging` module previously defined in v0.9.0.c s0|}t|dkr t|St|dkr>td|jd|\}}}}}|ddkpn|ddkpn|ddk}|rt|ddd|dd|dd|df}|dddddddddddddf} |dddddddddddddf} |dddddddddddddf} |dddddddddddddf} |dddddddddddddf} |dddddddddddddf}|dddddddddddddf}|dddddddddddddf}t | | | | | |||gd}| |}| |}|S) NrOrzexpecting 5D x, got rrr@rr) rrrSrrUrrrrrrr}r|)rfrrrrrrrrx0x1x2x3x4x5x6x7rgrirjrs*   $(,,,,,,,,  zPatchMerging.forward)rrrrrrririrgrjrs)r,Z mergingv2c Csd}t|dkr|\}}}tjd|||df|d}t|d t|d |d t|d dfD]}t|d t|d |d t|d dfD]^}t|d t|d |d t|d dfD]&}||dd|||ddf<|d7}qqqdnt|dkr|\}}tjd||df|d}t|d t|d |d t|d dfD]`}t|d t|d |d t|d dfD]&}||dd||ddf<|d7}qq\t||} | d} | d| d} | | dktd| dktd } | S) adComputing region masks based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer Args: dims: dimension values. window_size: local window size. shift_size: shift size. device: device. rr&r@)deviceNrrgYr+) rrrrslicersqueezer masked_fillr/) rrDrrcntrrrZimg_maskZ mask_windowsrririrj compute_masks*   66666  $r"csXeZdZdZddddejddfdddddd d d d d d d d d fdd ZddZZS)rz Basic Swin Transformer layer in one stage based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer rAFr+Nr-r.rr/r0rznn.Module | Noner1) rdepthr5rDrrErFrrrHrIr<r>c st|_tdd|D_tdd|D_|_ _t  f ddt |D_ | _ t j r| tjd_ dS)a Args: dim: number of feature channels. depth: number of layers in each stage. num_heads: number of attention heads. window_size: local window size. drop_path: stochastic depth rate. mlp_ratio: ratio of mlp hidden dim to embedding dim. qkv_bias: add a learnable bias to query, key, value. drop: dropout rate. attn_drop: attention dropout rate. norm_layer: normalization layer. downsample: an optional downsampling layer at the end of the layer. use_checkpoint: use gradient checkpointing for reduced memory usage. css|]}|dVqdS)rNrirririrjrbsz&BasicLayer.__init__..css|] }dVqdSrrirririrjrcscsRg|]J}tj|ddkr$jnjttrB|n d qS)rr) rr5rDrrErFrrrrHr<)rrDno_shiftrrXrr rrrrrErHr5rFrfr<rirjrgsz'BasicLayer.__init__..)rrHr=N)rSrTrDrrr$r#r<rW ModuleListrryrIcallabler) rfrr#r5rDrrErFrrrHrIr<rgr%rjrTAs  zBasicLayer.__init__cCs|}t|dkr|\}}}}}t|||f|j|j\}} t|d}tt||d|d} tt||d|d} tt||d|d} t | | | g|| |j } |j D]}||| }q| ||||d}|j dk r| |}t|d}nt|dkr|\}}}}t||f|j|j\}} t|d }tt||d|d} tt||d|d} t | | g|| |j } |j D]}||| }q| |||d}|j dk r| |}t|d }|S) Nrzb c d h w -> b d h w crr@rrzb d h w c -> b c d h wrOzb c h w -> b h w czb h w c -> b c h w)rrrrDrrr-rceilr"rryrrI)rfrrrrrrrrDrrrrrblkririrjr|s:             zBasicLayer.forwardrririrgrjr9s,;csreZdZdZdddddejdddddf ddd d d d d d d d d d d d dd dfdd ZdddZdddZZ S)rz Swin Transformer based on: "Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows " https://github.com/microsoft/Swin-Transformer rATr+Fr&r,r-r.r/r0rr1)rBrCrDrr4r5rErFr8r9rGrH patch_normr<r=r>csXtt||_||_| |_||_||_t|j|||jr@| nd|d|_ t j | d|_ ddt d| t|D}||_t |_t |_t |_t |_|jrt |_t |_t |_t |_t|trt|tn|}t|jD]D}tt |d||||||j|t|d|t|d|d||| | | ||d }|dkrl|j!|nF|dkr|j!|n.|dkr|j!|n|d kr|j!||jrt"||d||d|d dd d d }|dkr|j!|q|dkr|j!|q|dkr&|j!|q|d kr|j!|qt |d|jd|_#dS)a Args: in_chans: dimension of input channels. embed_dim: number of linear projection output channels. window_size: local window size. patch_size: patch size. depths: number of layers in each stage. num_heads: number of attention heads. mlp_ratio: ratio of mlp hidden dim to embedding dim. qkv_bias: add a learnable bias to query, key, value. drop_rate: dropout rate. attn_drop_rate: attention dropout rate. drop_path_rate: stochastic depth rate. norm_layer: normalization layer. patch_norm: add normalization after patch embedding. use_checkpoint: use gradient checkpointing for reduced memory usage. spatial_dims: spatial dimension. downsample: module used for downsampling, available options are `"mergingv2"`, `"merging"` and a user-specified `nn.Module` following the API defined in :py:class:`monai.networks.nets.PatchMerging`. The default is currently `"merging"` (the original version defined in v0.9.0). use_v2: using swinunetr_v2, which adds a residual convolution block at the beginning of each swin stage. N)rrBrCrHr=)pcSsg|] }|qSri)item)rrririrjrsz,SwinTransformer.__init__..rrr@) rr#r5rDrrErFrrrHrIr<r&r*TrK)$rSrTr num_layersrCr*rDrrrtrWrpos_droprrlinspacerrJr&rlrorprqlayers1clayers2clayers3clayers4crXrYrrrrr-appendr num_features)rfrBrCrDrr4r5rErFr8r9rGrHr*r<r=rIrJZdprZdown_sample_modi_layerrnZlayercrgrirjrTs+           &          zSwinTransformer.__init__c Cs|r|}t|dkrJ|\}}}}}t|d}t||g}t|d}n:t|dkr|\}}}}t|d}t||g}t|d}|S)Nrzn c d h w -> n d h w czn d h w c -> n c d h wrOzn c h w -> n h w czn h w c -> n c h w)rrrr layer_norm) rfrr;rrchrrrririrjproj_outs       zSwinTransformer.proj_outc Cs||}||}|||}|jr8|jd|}|jd|}|||}|jrn|jd|}|jd|}|||}|jr|j d|}|j d|} || |} |jr|j d| } |j d| } || |} |||| | gS)Nr) rtr.r9rJr0rrlr1ror2rpr3rq) rfrr;rZx0_outrZx1_outrZx2_outrZx3_outrZx4_outririrjr%s(       zSwinTransformer.forward)F)T) rrrrrWrrTr9rrririrgrjrs2q cCsj|dkr dS|dddkrb|dddkr>d|dd}nd|dd|d d}||fSdSdS) a A filter function used to filter the pretrained weights from [1], then the weights can be loaded into MONAI SwinUNETR Model. This function is typically used with `monai.networks.copy_model_state` [1] "Valanarasu JM et al., Disruptive Autoencoders: Leveraging Low-level features for 3D Medical Image Pre-training " Args: key: the key in the source state dict used for the update. value: the value in the source state dict used for the update. Examples:: import torch from monai.apps import download_url from monai.networks.utils import copy_model_state from monai.networks.nets.swin_unetr import SwinUNETR, filter_swinunetr model = SwinUNETR(img_size=(96, 96, 96), in_channels=1, out_channels=3, feature_size=48) resource = ( "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/ssl_pretrained_weights.pth" ) ssl_weights_path = "./ssl_pretrained_weights.pth" download_url(resource, ssl_weights_path) ssl_weights = torch.load(ssl_weights_path)["model"] dst_dict, loaded, not_loaded = copy_model_state(model, ssl_weights, filter_func=filter_swinunetr) )zencoder.mask_tokenzencoder.norm.weightzencoder.norm.biaszout.conv.conv.weightzout.conv.conv.biasNrQzencoder.rtzswinViT.ri)keyvaluenew_keyririrjfilter_swinunetr<sr@)N)4 __future__rrcollections.abcrnumpyrrrtorch.nnrWtorch.nn.functional functionalrtorch.utils.checkpointutilsr rtyping_extensionsrmonai.networks.blocksrrrrr r monai.networks.layersr r monai.utilsr rrZmonai.utils.deprecate_utilsrrr__all__Modulerrrrrrrrrr"rrr@riririrj sV       '! m'0 (d