class_docstr: Vision Transformer (ViT), based on: "Dosovitskiy et al.,
  An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale <https://arxiv.org/abs/2010.11929>"
  
  ViT supports Torchscript but only works for Pytorch after 1.8.
class_docstr_tok: ["Vision","Transformer","(","ViT",")",",","based","on",":","``","Dosovitskiy","et","al.",",","An","Image","is","Worth","16x16","Words",":","Transformers","for","Image","Recognition","at","Scale","<","https",":","\/\/arxiv.org\/abs\/2010.11929",">","''","ViT","supports","Torchscript","but","only","works","for","Pytorch","after","1.8","."]
code: def forward(self, x):
      x = self.patch_embedding(x)
      if hasattr(self, "cls_token"):
          cls_token = self.cls_token.expand(x.shape[0], -1, -1)
          x = torch.cat((cls_token, x), dim=1)
      hidden_states_out = []
      for blk in self.blocks:
          x = blk(x)
          hidden_states_out.append(x)
      x = self.norm(x)
      if hasattr(self, "classification_head"):
          x = self.classification_head(x[:, 0])
      return x, hidden_states_out
  
file_path: MONAI/monai/networks/nets/vit.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  from monai.networks.blocks.patchembedding import PatchEmbeddingBlock
  from monai.networks.blocks.transformerblock import TransformerBlock
  from monai.utils import deprecated_arg
label_desc: Use image node_id 2 for calling the ViT obj's underlying member method code with example usage: obj.forward(x) and returns: x,  hidden_states_out