class_docstr: Block in Shunted Transformer
  
  Args:
      dim (`int`): feature dimension
      num_heads (`int`): number of attention heads
      mlp_ratio (`float`): number to scale hidden dimension in mlp
      qkv_bias (`bool`): flag to use bias in qkv
      qk_scale (`int`): number to scale qk
      drop (`float`): drop rate of Mlp
      attn_drop (`float`): drop rate of attention
      drop_path (`float`): drop rate of drop path
      act_layer (`nn.Module`): activation layer
      norm_layer (`nn.Module`): normalization layer
      sr_ratio (`int`): shunt rate
class_docstr_tok: ["Block","in","Shunted","Transformer","Args",":","dim","(","`","int","`",")",":","feature","dimension","num_heads","(","`","int","`",")",":","number","of","attention","heads","mlp_ratio","(","`","float","`",")",":","number","to","scale","hidden","dimension","in","mlp","qkv_bias","(","`","bool","`",")",":","flag","to","use","bias","in","qkv","qk_scale","(","`","int","`",")",":","number","to","scale","qk","drop","(","`","float","`",")",":","drop","rate","of","Mlp","attn_drop","(","`","float","`",")",":","drop","rate","of","attention","drop_path","(","`","float","`",")",":","drop","rate","of","drop","path","act_layer","(","`","nn.Module","`",")",":","activation","layer","norm_layer","(","`","nn.Module","`",")",":","normalization","layer","sr_ratio","(","`","int","`",")",":","shunt","rate"]
code: def __init__(
      self,
      dim,
      num_heads,
      mlp_ratio=4.0,
      qkv_bias=False,
      qk_scale=None,
      drop=0.0,
      attn_drop=0.0,
      drop_path=0.0,
      act_layer=nn.GELU,
      norm_layer=nn.LayerNorm,
      sr_ratio=1,
  ):
      super().__init__()
      self.norm1 = norm_layer(dim)
      self.attn = Attention(
          dim,
          num_heads=num_heads,
          qkv_bias=qkv_bias,
          qk_scale=qk_scale,
          attn_drop=attn_drop,
          proj_drop=drop,
          sr_ratio=sr_ratio,
      )
      self.drop_path = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
      self.norm2 = norm_layer(dim)
      mlp_hidden_dim = int(dim * mlp_ratio)
      self.mlp = Mlp(
          in_features=dim,
          hidden_features=mlp_hidden_dim,
          act_layer=act_layer,
          drop=drop,
      )
  
      self.apply(init_vit_weights)
  
imports: import torch
  from torch import nn
  from towhee.models.layers.patch_embed2d import PatchEmbed2D
  from towhee.models.layers.mlp import Mlp
  from towhee.models.layers.droppath import DropPath
  from towhee.models.utils.init_vit_weights import init_vit_weights
label_desc: Use image node_id 1 to create a new Block object from inherited base classes: nn with example: obj = Block(dim, num_heads, mlp_ratio, qkv_bias, qk_scale, drop, attn_drop, drop_path, act_layer, norm_layer, sr_ratio)