class_docstr: Vision Transformer with support for patch or hybrid CNN input stage.
class_docstr_tok: ["Vision","Transformer","with","support","for","patch","or","hybrid","CNN","input","stage","."]
code: def forward(self, x):
      x = self.patch_embed(x)
      if self.pos_embed is not None:
          x = x + get_abs_pos(
              self.pos_embed,
              self.pretrain_use_cls_token,
              (x.shape[1], x.shape[2]),
          )
  
      for blk in self.blocks:
          x = blk(x)
  
      x = x.permute(0, 3, 1, 2)
  
      return x
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import build_activation_layer, build_norm_layer
  from mmcv.cnn.bricks import DropPath
  from mmengine.logging import MMLogger
  from mmengine.model import BaseModule
  from mmengine.runner.checkpoint import CheckpointLoader
  from mmdet.registry import MODELS
label_desc: Use image node_id 4 for calling the ViT obj's underlying member method code with example usage: obj.forward(x) and returns: x