class_docstr: TNT Block
      
code: def __init__(
      self,
      dim,
      dim_out,
      num_pixel,
      num_heads_in=4,
      num_heads_out=12,
      mlp_ratio=4.0,
      qkv_bias=False,
      proj_drop=0.0,
      attn_drop=0.0,
      drop_path=0.0,
      act_layer=nn.GELU,
      norm_layer=nn.LayerNorm,
  ):
      super().__init__()
      # Inner transformer
      self.norm_in = norm_layer(dim)
      self.attn_in = Attention(
          dim,
          dim,
          num_heads=num_heads_in,
          qkv_bias=qkv_bias,
          attn_drop=attn_drop,
          proj_drop=proj_drop,
      )
  
      self.norm_mlp_in = norm_layer(dim)
      self.mlp_in = Mlp(
          in_features=dim,
          hidden_features=int(dim * 4),
          out_features=dim,
          act_layer=act_layer,
          drop=proj_drop,
      )
  
      self.norm1_proj = norm_layer(dim)
      self.proj = nn.Linear(dim * num_pixel, dim_out, bias=True)
  
      # Outer transformer
      self.norm_out = norm_layer(dim_out)
      self.attn_out = Attention(
          dim_out,
          dim_out,
          num_heads=num_heads_out,
          qkv_bias=qkv_bias,
          attn_drop=attn_drop,
          proj_drop=proj_drop,
      )
      self.drop_path = (
          DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
      )
  
      self.norm_mlp = norm_layer(dim_out)
      self.mlp = Mlp(
          in_features=dim_out,
          hidden_features=int(dim_out * mlp_ratio),
          out_features=dim_out,
          act_layer=act_layer,
          drop=proj_drop,
      )
  
imports: import math
  import torch
  import torch.nn
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import Mlp, DropPath, trunc_normal_, _assert, to_2tuple
  from ._builder import build_model_with_cfg
  from ._registry import register_model
  from .vision_transformer import resize_pos_embed
label_desc: Use image node_id 1 to create a new Block object from inherited base classes: nn with example: obj = Block(dim, dim_out, num_pixel, num_heads_in, num_heads_out, mlp_ratio, qkv_bias, proj_drop, attn_drop, drop_path, act_layer, norm_layer)