class_docstr: Swin UNETR based on: "Hatamizadeh et al.,
  Swin UNETR: Swin Transformers for Semantic Segmentation of Brain Tumors in MRI Images
  <https://arxiv.org/abs/2201.01266>"
code: def load_from(self, weights):
      with torch.no_grad():
          self.swinViT.patch_embed.proj.weight.copy_(
              weights["state_dict"]["module.patch_embed.proj.weight"]
          )
          self.swinViT.patch_embed.proj.bias.copy_(
              weights["state_dict"]["module.patch_embed.proj.bias"]
          )
          for bname, block in self.swinViT.layers1[
              0
          ].blocks.named_children():
              block.load_from(weights, n_block=bname, layer="layers1")
          self.swinViT.layers1[0].downsample.reduction.weight.copy_(
              weights["state_dict"][
                  "module.layers1.0.downsample.reduction.weight"
              ]
          )
          self.swinViT.layers1[0].downsample.norm.weight.copy_(
              weights["state_dict"][
                  "module.layers1.0.downsample.norm.weight"
              ]
          )
          self.swinViT.layers1[0].downsample.norm.bias.copy_(
              weights["state_dict"][
                  "module.layers1.0.downsample.norm.bias"
              ]
          )
          for bname, block in self.swinViT.layers2[
              0
          ].blocks.named_children():
              block.load_from(weights, n_block=bname, layer="layers2")
          self.swinViT.layers2[0].downsample.reduction.weight.copy_(
              weights["state_dict"][
                  "module.layers2.0.downsample.reduction.weight"
              ]
          )
          self.swinViT.layers2[0].downsample.norm.weight.copy_(
              weights["state_dict"][
                  "module.layers2.0.downsample.norm.weight"
              ]
          )
          self.swinViT.layers2[0].downsample.norm.bias.copy_(
              weights["state_dict"][
                  "module.layers2.0.downsample.norm.bias"
              ]
          )
          for bname, block in self.swinViT.layers3[
              0
          ].blocks.named_children():
              block.load_from(weights, n_block=bname, layer="layers3")
          self.swinViT.layers3[0].downsample.reduction.weight.copy_(
              weights["state_dict"][
                  "module.layers3.0.downsample.reduction.weight"
              ]
          )
          self.swinViT.layers3[0].downsample.norm.weight.copy_(
              weights["state_dict"][
                  "module.layers3.0.downsample.norm.weight"
              ]
          )
          self.swinViT.layers3[0].downsample.norm.bias.copy_(
              weights["state_dict"][
                  "module.layers3.0.downsample.norm.bias"
              ]
          )
          for bname, block in self.swinViT.layers4[
              0
          ].blocks.named_children():
              block.load_from(weights, n_block=bname, layer="layers4")
          self.swinViT.layers4[0].downsample.reduction.weight.copy_(
              weights["state_dict"][
                  "module.layers4.0.downsample.reduction.weight"
              ]
          )
          self.swinViT.layers4[0].downsample.norm.weight.copy_(
              weights["state_dict"][
                  "module.layers4.0.downsample.norm.weight"
              ]
          )
          self.swinViT.layers4[0].downsample.norm.bias.copy_(
              weights["state_dict"][
                  "module.layers4.0.downsample.norm.bias"
              ]
          )
  
imports: from __future__ import annotations
  import itertools
  from collections.abc import Sequence
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from torch.nn import LayerNorm
  from typing_extensions import Final
  from monai.networks.blocks import MLPBlock
  from monai.networks.blocks import PatchEmbed, UnetOutBlock, UnetrBasicBlock, UnetrUpBlock
  from monai.networks.layers import DropPath, trunc_normal_
  from monai.utils import ensure_tuple_rep, look_up_option, optional_import
  from monai.utils.deprecate_utils import deprecated_arg
label_desc: Use image node_id 2 for calling the SwinUNETR obj's underlying member method code with example usage: obj.load_from(weights) without return types