code: def __init__(
      self,
      img_size=224,
      patch_size=16,
      in_chans=3,
      num_classes=1000,
      embed_dims=[64, 128, 256, 512],
      num_heads=[1, 2, 4, 8],
      mlp_ratios=[4, 4, 4, 4],
      qkv_bias=False,
      qk_scale=None,
      drop_rate=0.0,
      attn_drop_rate=0.0,
      drop_path_rate=0.0,
      norm_layer=LayerNorm,
      depths=[3, 4, 6, 3],
      sr_ratios=[8, 4, 2, 1],
      output_avg=False,
  ):
      super().__init__()
      self.num_classes = num_classes
      self.depths = depths
      self.output_avg = output_avg
  
      # patch_embed
      self.patch_embed1 = OverlapPatchEmbed(
          img_size=img_size,
          patch_size=7,
          stride=4,
          in_chans=in_chans,
          embed_dim=embed_dims[0],
      )
      self.patch_embed2 = OverlapPatchEmbed(
          img_size=img_size // 4,
          patch_size=3,
          stride=2,
          in_chans=embed_dims[0],
          embed_dim=embed_dims[1],
      )
      self.patch_embed3 = OverlapPatchEmbed(
          img_size=img_size // 8,
          patch_size=3,
          stride=2,
          in_chans=embed_dims[1],
          embed_dim=embed_dims[2],
      )
      self.patch_embed4 = OverlapPatchEmbed(
          img_size=img_size // 16,
          patch_size=3,
          stride=2,
          in_chans=embed_dims[2],
          embed_dim=embed_dims[3],
      )
  
      # transformer encoder
      dpr = [
          x.item()
          for x in torch.linspace(0, drop_path_rate, sum(depths))
      ]  # stochastic depth decay rule
      cur = 0
      self.block1 = nn.ModuleList(
          [
              Block(
                  dim=embed_dims[0],
                  num_heads=num_heads[0],
                  mlp_ratio=mlp_ratios[0],
                  qkv_bias=qkv_bias,
                  qk_scale=qk_scale,
                  drop=drop_rate,
                  attn_drop=attn_drop_rate,
                  drop_path=dpr[cur + i],
                  norm_layer=norm_layer,
                  sr_ratio=sr_ratios[0],
              )
              for i in range(depths[0])
          ]
      )
      self.norm1 = norm_layer(embed_dims[0])
  
      cur += depths[0]
      self.block2 = nn.ModuleList(
          [
              Block(
                  dim=embed_dims[1],
                  num_heads=num_heads[1],
                  mlp_ratio=mlp_ratios[1],
                  qkv_bias=qkv_bias,
                  qk_scale=qk_scale,
                  drop=drop_rate,
                  attn_drop=attn_drop_rate,
                  drop_path=dpr[cur + i],
                  norm_layer=norm_layer,
                  sr_ratio=sr_ratios[1],
              )
              for i in range(depths[1])
          ]
      )
      self.norm2 = norm_layer(embed_dims[1])
  
      cur += depths[1]
      self.block3 = nn.ModuleList(
          [
              Block(
                  dim=embed_dims[2],
                  num_heads=num_heads[2],
                  mlp_ratio=mlp_ratios[2],
                  qkv_bias=qkv_bias,
                  qk_scale=qk_scale,
                  drop=drop_rate,
                  attn_drop=attn_drop_rate,
                  drop_path=dpr[cur + i],
                  norm_layer=norm_layer,
                  sr_ratio=sr_ratios[2],
              )
              for i in range(depths[2])
          ]
      )
      self.norm3 = norm_layer(embed_dims[2])
  
      cur += depths[2]
      self.block4 = nn.ModuleList(
          [
              Block(
                  dim=embed_dims[3],
                  num_heads=num_heads[3],
                  mlp_ratio=mlp_ratios[3],
                  qkv_bias=qkv_bias,
                  qk_scale=qk_scale,
                  drop=drop_rate,
                  attn_drop=attn_drop_rate,
                  drop_path=dpr[cur + i],
                  norm_layer=norm_layer,
                  sr_ratio=sr_ratios[3],
              )
              for i in range(depths[3])
          ]
      )
      self.norm4 = norm_layer(embed_dims[3])
  
      self.apply(self._init_weights)
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from functools import partial
  from torch.nn.init import trunc_normal_
  from megatron.model.transformer import DropPath
  from megatron.model import LayerNorm
label_desc: Use image node_id 1 to create a new MixVisionTransformer object from inherited base classes: nn with example: obj = MixVisionTransformer(img_size, patch_size, in_chans, num_classes, embed_dims, num_heads, mlp_ratios, qkv_bias, qk_scale, drop_rate, attn_drop_rate, drop_path_rate, norm_layer, depths, sr_ratios, output_avg)