class_docstr: ## Vision Transformer
  
  This combines the [patch embeddings](#PatchEmbeddings),
  [positional embeddings](#LearnedPositionalEmbeddings),
  transformer and the [classification head](#ClassificationHead).
class_docstr_tok: ["#","#","Vision","Transformer","This","combines","the","[","patch","embeddings","]","(","#","PatchEmbeddings",")",",","[","positional","embeddings","]","(","#","LearnedPositionalEmbeddings",")",",","transformer","and","the","[","classification","head","]","(","#","ClassificationHead",")","."]
docstr: * `x` is the input image of shape `[batch_size, channels, height, width]`
docstr_tok: ["*","`","x","`","is","the","input","image","of","shape","`","[","batch_size",",","channels",",","height",",","width","]","`"]
code: def forward(self, x: torch.Tensor):
      """
      * `x` is the input image of shape `[batch_size, channels, height, width]`
      """
      # Get patch embeddings. This gives a tensor of shape `[patches, batch_size, d_model]`
      x = self.patch_emb(x)
      # Concatenate the `[CLS]` token embeddings before feeding the transformer
      cls_token_emb = self.cls_token_emb.expand(-1, x.shape[1], -1)
      x = torch.cat([cls_token_emb, x])
      # Add positional embeddings
      x = self.pos_emb(x)
  
      # Pass through transformer layers with no attention masking
      for layer in self.transformer_layers:
          x = layer(x=x, mask=None)
  
      # Get the transformer output of the `[CLS]` token (which is the first in the sequence).
      x = x[0]
  
      # Layer normalization
      x = self.ln(x)
  
      # Classification head, to get logits
      x = self.classification(x)
  
      #
      return x
  
imports: import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.transformers import TransformerLayer
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 2 for calling the VisionTransformer obj's underlying member method code with example usage: obj.forward(x) and returns: x