code: def __init__(
      self,
      in_channels=3,
      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=partial(nn.LayerNorm, eps=1e-6),
      depths=[3, 4, 6, 3],
      sr_ratios=[8, 4, 2, 1],
      activation=ACT_GELU,
      first_embedd_stride=4,
  ):
      super().__init__()
      self.depths = depths
  
      # patch_embed
      self.patch_embed1 = OverlapPatchEmbed(
          patch_size=7,
          stride=first_embedd_stride,
          in_chans=in_channels,
          embed_dim=embed_dims[0],
      )
      self.patch_embed2 = OverlapPatchEmbed(
          patch_size=3,
          stride=2,
          in_chans=embed_dims[0],
          embed_dim=embed_dims[1],
      )
      self.patch_embed3 = OverlapPatchEmbed(
          patch_size=3,
          stride=2,
          in_chans=embed_dims[1],
          embed_dim=embed_dims[2],
      )
      self.patch_embed4 = OverlapPatchEmbed(
          patch_size=3,
          stride=2,
          in_chans=embed_dims[2],
          embed_dim=embed_dims[3],
      )
      self.embed_dims = embed_dims
  
      # 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,
                  activation=activation,
                  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,
                  activation=activation,
                  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,
                  activation=activation,
                  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,
                  activation=activation,
                  sr_ratio=sr_ratios[3],
              )
              for i in range(depths[3])
          ]
      )
      self.norm4 = norm_layer(embed_dims[3])
  
      self.apply(self._init_weights)
      self.output_spec = FeatureMapsSpecification(
          channels=embed_dims,
          strides=(
              first_embedd_stride,
              first_embedd_stride * 2,
              first_embedd_stride * 4,
              first_embedd_stride * 8,
          ),
      )
  
imports: import math
  from functools import partial
  from typing import Optional
  import torch
  import torch.nn
  from pytorch_toolbelt.modules.interfaces import AbstractEncoder, FeatureMapsSpecification
  from pytorch_toolbelt.modules.activations import instantiate_activation_block, ACT_GELU
  from pytorch_toolbelt.modules.drop_path import DropPath
label_desc: Use image node_id 1 to create a new MixVisionTransformer object from inherited base classes: AbstractEncoder with example: obj = MixVisionTransformer(in_channels, embed_dims, num_heads, mlp_ratios, qkv_bias, qk_scale, drop_rate, attn_drop_rate, drop_path_rate, norm_layer, depths, sr_ratios, activation, first_embedd_stride)