class_docstr: This class defines the `Vision Transformer architecture <https://arxiv.org/abs/2010.11929>`_. Our model implementation
  is inspired from `Early Convolutions Help Transformers See Better <https://arxiv.org/abs/2106.14881>`_
  
  .. note::
      Our implementation is different from the original implementation in two ways:
      1. Kernel size is odd.
      2. Our positional encoding implementation allows us to use ViT with any multiple input scales
      3. We do not use StochasticDepth
      4. We do not add positional encoding to class token (if enabled), as suggested in `DeiT-3 paper <https://arxiv.org/abs/2204.07118>`_
class_docstr_tok: ["This","class","defines","the","`","Vision","Transformer","architecture","<","https",":","\/\/arxiv.org\/abs\/2010.11929",">","`","_",".","Our","model","implementation","is","inspired","from","`","Early","Convolutions","Help","Transformers","See","Better","<","https",":","\/\/arxiv.org\/abs\/2106.14881",">","`","_","..","note",":",":","Our","implementation","is","different","from","the","original","implementation","in","two","ways",":","1",".","Kernel","size","is","odd",".","2",".","Our","positional","encoding","implementation","allows","us","to","use","ViT","with","any","multiple","input","scales","3",".","We","do","not","use","StochasticDepth","4",".","We","do","not","add","positional","encoding","to","class","token","(","if","enabled",")",",","as","suggested","in","`","DeiT-3","paper","<","https",":","\/\/arxiv.org\/abs\/2204.07118",">","`","_"]
code: def extract_end_points_all(
      self,
      x: Tensor,
      use_l5: Optional[bool] = True,
      use_l5_exp: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Dict[str, Tensor]:
      # this function is often used in down-stream applications (especially in segmentation and detection)
      if self.cls_token:
          logger.error("Please disable cls token for down-stream tasks")
  
      out_dict = {}
      if self.training and self.neural_augmentor is not None:
          x = self.neural_augmentor(x)
          out_dict["augmented_tensor"] = x
  
      cls_emb, x = self.extract_features(
          x, return_image_embeddings=True
      )
      out_dict["cls_embedding"] = cls_emb
  
      if self.simple_fpn is not None:
          # build simple FPN, as suggested in https://arxiv.org/abs/2203.16527
          for k, extra_layer in self.simple_fpn.items():
              out_dict[k] = extra_layer(x)
      else:
          # ViT does not have hierarchical structure by default.
          # Therefore, we set first four levels to None
          out_dict["out_l1"] = None
          out_dict["out_l2"] = None
          out_dict["out_l3"] = None
          out_dict["out_l4"] = None
          if use_l5_exp:
              out_dict["out_l5"] = None
              out_dict["out_l5_exp"] = x
          else:
              out_dict["out_l5"] = x
              out_dict["out_l5_exp"] = None
      return out_dict
  
imports: import argparse
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.utils.checkpoint import checkpoint_sequential
  from cvnets.layers import ConvLayer2d, Dropout, Identity, LinearLayer, MaxPool2d, PositionalEmbedding, TransposeConvLayer2d, get_normalization_layer
  from cvnets.misc.common import parameter_list
  from cvnets.misc.init_utils import initialize_conv_layer
  from cvnets.models import MODEL_REGISTRY
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.classification.config.vit import get_configuration
  from cvnets.modules import TransformerEncoder
  from utils import logger
label_desc: Use image node_id 12 for calling the VisionTransformer obj's underlying member method code with example usage: obj.extract_end_points_all(x, use_l5, use_l5_exp) and returns: out_dict