class_docstr: Vision Transformer with support for patch input
  
  This module is different from ppdet's VisionTransformer (from ppdet/modeling/backbones/visio_transformer.py),
  the main differences are:
  1.the module PatchEmbed.proj has padding set,padding=(4 + 2 * (ratio // 2 - 1), 4 + 2 * (ratio // 2 - 1),
    VisionTransformer dose not
  2.Attention module qkv is standard.but VisionTransformer provide more options
  3.MLP module only one Dropout,and VisionTransformer twice;
  4.VisionTransformer provide fpn layer,but the module does not.
code: def __init__(
      self,
      img_size=224,
      patch_size=16,
      in_chans=3,
      embed_dim=768,
      depth=12,
      num_heads=12,
      mlp_ratio=4,
      qkv_bias=False,
      qk_scale=None,
      drop_rate=0.0,
      attn_drop_rate=0.0,
      drop_path_rate=0.0,
      norm_layer="nn.LayerNorm",
      epsilon=1e-5,
      ratio=1,
      pretrained=None,
      **kwargs,
  ):
      super().__init__()
  
      self.pretrained = pretrained
      self.num_features = self.embed_dim = embed_dim
  
      self.patch_embed = PatchEmbed(
          img_size=img_size,
          patch_size=patch_size,
          in_chans=in_chans,
          embed_dim=embed_dim,
          ratio=ratio,
      )
      num_patches = self.patch_embed.num_patches
  
      self.pos_embed = self.create_parameter(
          shape=(1, num_patches + 1, embed_dim),
          default_initializer=trunc_normal_,
      )
      self.add_parameter("pos_embed", self.pos_embed)
  
      dpr = np.linspace(0, drop_path_rate, depth, dtype="float32")
  
      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,
                  epsilon=epsilon,
              )
              for i in range(depth)
          ]
      )
  
      self.last_norm = eval(norm_layer)(embed_dim, epsilon=epsilon)
      trunc_normal_(self.pos_embed)
      self._init_weights()
  
imports: from collections.abc import Callable
  import numpy
  import paddle
  import paddle.nn
  from paddle.nn.initializer import TruncatedNormal, Constant, Normal
  from ppdet.core.workspace import register, serializable
label_desc: Use image node_id 1 to create a new ViT object from inherited base classes: nn with example: obj = ViT(img_size, patch_size, in_chans, embed_dim, depth, num_heads, mlp_ratio, qkv_bias, qk_scale, drop_rate, attn_drop_rate, drop_path_rate, norm_layer, epsilon, ratio, pretrained)