class_docstr: Vision transformer (ViT) module.
  
  The module is expected to be used as operator for different vision tasks.
  
  The method is inspired from existing implementations of the paper :cite:`dosovitskiy2020vit`.
  
  .. warning::
      This is an experimental API subject to changes in favor of flexibility.
  
  Args:
      image_size: the size of the input image.
      patch_size: the size of the patch to compute the embedding.
      in_channels: the number of channels for the input.
      embed_dim: the embedding dimension inside the transformer encoder.
      depth: the depth of the transformer.
      num_heads: the number of attention heads.
      dropout_rate: dropout rate.
      dropout_attn: attention dropout rate.
      backbone: an nn.Module to compute the image patches embeddings.
  
  Example:
      >>> img = torch.rand(1, 3, 224, 224)
      >>> vit = VisionTransformer(image_size=224, patch_size=16)
      >>> vit(img).shape
      torch.Size([1, 197, 768])
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      if not isinstance(x, torch.Tensor):
          raise TypeError(
              f"Input x type is not a torch.Tensor. Got: {type(x)}"
          )
  
      if (
          self.image_size not in (*x.shape[-2:],)
          and x.shape[-3] != self.in_channels
      ):
          raise ValueError(
              f"Input image shape must be Bx{self.in_channels}x{self.image_size}x{self.image_size}. Got: {x.shape}"
          )
  
      out = self.patch_embedding(x)
      out = self.encoder(out)
      return out
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 3 for calling the VisionTransformer obj's underlying member method code with example usage: obj.forward(x) and returns: out