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 __init__(
      self,
      image_size: int = 224,
      patch_size: int = 16,
      in_channels: int = 3,
      embed_dim: int = 768,
      depth: int = 12,
      num_heads: int = 12,
      dropout_rate: float = 0.0,
      dropout_attn: float = 0.0,
      backbone: Optional[Module] = None,
  ) -> None:
      super().__init__()
      self.image_size = image_size
      self.patch_size = patch_size
      self.in_channels = in_channels
      self.embed_size = embed_dim
  
      self.patch_embedding = PatchEmbedding(
          in_channels, embed_dim, patch_size, image_size, backbone
      )
      hidden_dim = self.patch_embedding.out_channels
      self.encoder = TransformerEncoder(
          hidden_dim, depth, num_heads, dropout_rate, dropout_attn
      )
  
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 1 to create a new VisionTransformer object from inherited base classes: Module with example: obj = VisionTransformer(image_size, patch_size, in_channels, embed_dim, depth, num_heads, dropout_rate, dropout_attn, backbone)