class_docstr: This class defines the pre-norm transformer encoder with linear self-attention in `MobileViTv2 <https://arxiv.org/abs/2206.02680>`_ paper
  Args:
      opts: command line arguments
      embed_dim (int): :math:`C_{in}` from an expected input of size :math:`(B, C_{in}, P, N)`
      ffn_latent_dim (int): Inner dimension of the FFN
      attn_dropout (Optional[float]): Dropout rate for attention in multi-head attention. Default: 0.0
      dropout (Optional[float]): Dropout rate. Default: 0.0
      ffn_dropout (Optional[float]): Dropout between FFN layers. Default: 0.0
      norm_layer (Optional[str]): Normalization layer. Default: layer_norm_2d
  
  Shape:
      - Input: :math:`(B, C_{in}, P, N)` where :math:`B` is batch size, :math:`C_{in}` is input embedding dim,
          :math:`P` is number of pixels in a patch, and :math:`N` is number of patches,
      - Output: same shape as the input
class_docstr_tok: ["This","class","defines","the","pre-norm","transformer","encoder","with","linear","self-attention","in","`","MobileViTv2","<","https",":","\/\/arxiv.org\/abs\/2206.02680",">","`","_","paper","Args",":","opts",":","command","line","arguments","embed_dim","(","int",")",":",":","math",":","`","C_","{","in","}","`","from","an","expected","input","of","size",":","math",":","`","(","B",",","C_","{","in","}",",","P",",","N",")","`","ffn_latent_dim","(","int",")",":","Inner","dimension","of","the","FFN","attn_dropout","(","Optional","[","float","]",")",":","Dropout","rate","for","attention","in","multi-head","attention",".","Default",":","0.0","dropout","(","Optional","[","float","]",")",":","Dropout","rate",".","Default",":","0.0","ffn_dropout","(","Optional","[","float","]",")",":","Dropout","between","FFN","layers",".","Default",":","0.0","norm_layer","(","Optional","[","str","]",")",":","Normalization","layer",".","Default",":","layer_norm_2d","Shape",":","-","Input",":",":","math",":","`","(","B",",","C_","{","in","}",",","P",",","N",")","`","where",":","math",":","`","B","`","is","batch","size",",",":","math",":","`","C_","{","in","}","`","is","input","embedding","dim",",",":","math",":","`","P","`","is","number","of","pixels","in","a","patch",",","and",":","math",":","`","N","`","is","number","of","patches",",","-","Output",":","same","shape","as","the","input"]
code: def __repr__(self) -> str:
      return "{}(embed_dim={}, ffn_dim={}, dropout={}, ffn_dropout={}, attn_fn={}, norm_layer={})".format(
          self.__class__.__name__,
          self.embed_dim,
          self.ffn_dim,
          self.std_dropout,
          self.ffn_dropout,
          self.attn_fn_name,
          self.norm_name,
      )
  
file_path: ml-cvnets/cvnets/modules/transformer.py
imports: import argparse
  from typing import Optional
  from torch import Tensor, nn
  from cvnets.layers import ConvLayer2d, Dropout, Identity, LinearLayer, LinearSelfAttention, MultiHeadAttention, SingleHeadAttention, StochasticDepth, get_normalization_layer
  from cvnets.layers.activation import build_activation_layer
  from cvnets.modules import BaseModule
  from utils import logger
label_desc: Use image node_id 2 for calling the LinearAttnFFN obj's underlying member method code with example usage: obj.__repr__() and returns: str