class_docstr: Vision Transformer with support for patch input
      
class_docstr_tok: ["Vision","Transformer","with","support","for","patch","input"]
code: def forward(self, inputs):
      x = self.patch_embed(inputs["image"]).transpose([0, 2, 3, 1])
      B, Hp, Wp, _ = paddle.shape(x)
  
      if self.use_abs_pos:
          x = x + self.get_2d_sincos_position_embedding(Hp, Wp)
  
      if self.use_abs_pos_emb:
          x = x + self.resize_pos_embed(
              self.pos_embed, (self.pos_h, self.pos_w), (Hp, Wp)
          )
  
      feats = []
      for idx, blk in enumerate(self.blocks):
          if self.use_checkpoint and self.training:
              x = paddle.distributed.fleet.utils.recompute(
                  blk, x, **{"preserve_rng_state": True}
              )
          else:
              x = blk(x)
          if idx in self.out_indices:
              feats.append(self.norm(x.transpose([0, 3, 1, 2])))
  
      if self.with_fpn:
          fpns = [self.fpn1, self.fpn2, self.fpn3, self.fpn4]
          for i in range(len(feats)):
              feats[i] = fpns[i](feats[i])
      return feats
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  import numpy
  import math
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn.initializer import Constant, TruncatedNormal
  from ppdet.modeling.shape_spec import ShapeSpec
  from ppdet.core.workspace import register, serializable
  from .transformer_utils import zeros_, DropPath, Identity, window_partition, window_unpartition
  from ..initializer import linear_init_
label_desc: Use image node_id 7 for calling the VisionTransformer2D obj's underlying member method code with example usage: obj.forward(inputs) and returns: feats