class_docstr: Reparameterizable token mixer
  
  For more details, please refer to our paper:
  `FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization`
  
  Args:
      opts: Command line arguments.
      dim: Input feature map dimension. :math:`C_{in}` from an expected input of size :math:`(B, C_{in}, H, W)`.
      kernel_size: Kernel size for spatial mixing. Default: 3
      use_layer_scale: If True, learnable layer scale is used. Default: ``True``
      layer_scale_init_value: Initial value for layer scale. Default: 1e-5
      inference_mode: If True, instantiates model in inference mode. Default: ``False``
class_docstr_tok: ["Reparameterizable","token","mixer","For","more","details",",","please","refer","to","our","paper",":","`","FastViT",":","A","Fast","Hybrid","Vision","Transformer","using","Structural","Reparameterization","`","Args",":","opts",":","Command","line","arguments",".","dim",":","Input","feature","map","dimension",".",":","math",":","`","C_","{","in","}","`","from","an","expected","input","of","size",":","math",":","`","(","B",",","C_","{","in","}",",","H",",","W",")","`",".","kernel_size",":","Kernel","size","for","spatial","mixing",".","Default",":","3","use_layer_scale",":","If","True",",","learnable","layer","scale","is","used",".","Default",":","``","True","``","layer_scale_init_value",":","Initial","value","for","layer","scale",".","Default",":","1e-5","inference_mode",":","If","True",",","instantiates","model","in","inference","mode",".","Default",":","``","False","``"]
docstr: Forward pass implements inference logic for module
  before and after reparameterization.
  
  Args:
      x: Input tensor of shape :math:`(B, C, H, W)`.
  
  Returns:
      torch.Tensor of shape :math:`(B, C, H, W)`.
docstr_tok: ["Forward","pass","implements","inference","logic","for","module","before","and","after","reparameterization",".","Args",":","x",":","Input","tensor","of","shape",":","math",":","`","(","B",",","C",",","H",",","W",")","`",".","Returns",":","torch.Tensor","of","shape",":","math",":","`","(","B",",","C",",","H",",","W",")","`","."]
code: def forward(self, x: torch.Tensor, *args, **kwargs) -> torch.Tensor:
      """
      Forward pass implements inference logic for module
      before and after reparameterization.
  
      Args:
          x: Input tensor of shape :math:`(B, C, H, W)`.
  
      Returns:
          torch.Tensor of shape :math:`(B, C, H, W)`.
      """
      if hasattr(self, "reparam_conv"):
          x = self.reparam_conv(x)
          return x
      else:
          if self.use_layer_scale:
              x = x + self.layer_scale * (self.mixer(x) - self.norm(x))
          else:
              x = x + self.mixer(x) - self.norm(x)
          return x
  
imports: import argparse
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn
  from cvnets.layers import ConvLayer2d, MultiHeadAttention, StochasticDepth
  from cvnets.layers.normalization.batch_norm import BatchNorm2d
  from cvnets.modules import BaseModule
  from cvnets.modules.mobileone_block import MobileOneBlock, RepLKBlock
label_desc: Use image node_id 2 for calling the RepMixer obj's underlying member method code with example usage: obj.forward(x) and returns: x, x