code: def __init__(
      self,
      img_size=[224, 224],
      in_channels=1,
      scale="tiny",
      seqlen=27,
      patch_size=[16, 16],
      embed_dim=None,
      depth=12,
      num_heads=None,
      mlp_ratio=4,
      qkv_bias=True,
      qk_scale=None,
      drop_path_rate=0.0,
      drop_rate=0.0,
      attn_drop_rate=0.0,
      norm_layer="nn.LayerNorm",
      act_layer="nn.GELU",
      epsilon=1e-6,
      out_channels=None,
      **kwargs,
  ):
      super().__init__()
      self.seqlen = seqlen
      embed_dim = (
          embed_dim
          if embed_dim is not None
          else scale_dim_heads[scale][0]
      )
      num_heads = (
          num_heads
          if num_heads is not None
          else scale_dim_heads[scale][1]
      )
      out_channels = (
          out_channels if out_channels is not None else embed_dim
      )
      self.patch_embed = PatchEmbed(
          img_size=img_size,
          in_channels=in_channels,
          embed_dim=embed_dim,
          patch_size=patch_size,
          mode="linear",
      )
      num_patches = self.patch_embed.num_patches
  
      self.pos_embed = self.create_parameter(
          shape=[1, num_patches + 1, embed_dim],
          default_initializer=zeros_,
      )
      self.add_parameter("pos_embed", self.pos_embed)
      self.cls_token = self.create_parameter(
          shape=[1, 1, embed_dim], default_initializer=zeros_
      )
      self.add_parameter("cls_token", self.cls_token)
  
      self.pos_drop = nn.Dropout(p=drop_rate)
  
      dpr = np.linspace(0, drop_path_rate, depth)
      self.blocks = nn.LayerList(
          [
              Block(
                  dim=embed_dim,
                  num_heads=num_heads,
                  mlp_ratio=mlp_ratio,
                  qkv_bias=qkv_bias,
                  qk_scale=qk_scale,
                  drop=drop_rate,
                  attn_drop=attn_drop_rate,
                  drop_path=dpr[i],
                  norm_layer=norm_layer,
                  act_layer=eval(act_layer),
                  epsilon=epsilon,
                  prenorm=False,
              )
              for i in range(depth)
          ]
      )
      self.norm = eval(norm_layer)(embed_dim, epsilon=epsilon)
  
      self.out_channels = out_channels
  
      trunc_normal_(self.pos_embed)
      trunc_normal_(self.cls_token)
      self.apply(self._init_weights)
  
file_path: PaddleOCR/ppocr/modeling/backbones/rec_vitstr.py
imports: import numpy
  import paddle
  import paddle.nn
  from ppocr.modeling.backbones.rec_svtrnet import Block, PatchEmbed, zeros_, trunc_normal_, ones_
label_desc: Use image node_id 1 to create a new ViTSTR object from inherited base classes: nn with example: obj = ViTSTR(img_size, in_channels, scale, seqlen, patch_size, embed_dim, depth, num_heads, mlp_ratio, qkv_bias, qk_scale, drop_path_rate, drop_rate, attn_drop_rate, norm_layer, act_layer, epsilon, out_channels)