class_docstr: This class defines the `MobileViT block <https://arxiv.org/abs/2110.02178?context=cs.LG>`_
  
  Args:
      opts: command line arguments
      in_channels (int): :math:`C_{in}` from an expected input of size :math:`(N, C_{in}, H, W)`
      transformer_dim (int): Input dimension to the transformer unit
      ffn_dim (int): Dimension of the FFN block
      n_transformer_blocks (Optional[int]): Number of transformer blocks. Default: 2
      head_dim (Optional[int]): Head dimension in the multi-head attention. Default: 32
      attn_dropout (Optional[float]): Dropout in multi-head attention. Default: 0.0
      dropout (Optional[float]): Dropout rate. Default: 0.0
      ffn_dropout (Optional[float]): Dropout between FFN layers in transformer. Default: 0.0
      patch_h (Optional[int]): Patch height for unfolding operation. Default: 8
      patch_w (Optional[int]): Patch width for unfolding operation. Default: 8
      transformer_norm_layer (Optional[str]): Normalization layer in the transformer block. Default: layer_norm
      conv_ksize (Optional[int]): Kernel size to learn local representations in MobileViT block. Default: 3
      dilation (Optional[int]): Dilation rate in convolutions. Default: 1
      no_fusion (Optional[bool]): Do not combine the input and output feature maps. Default: False
code: def forward(
      self, x: Union[Tensor, Tuple[Tensor]], *args, **kwargs
  ) -> Union[Tensor, Tuple[Tensor, Tensor]]:
      if isinstance(x, Tuple) and len(x) == 2:
          # for spatio-temporal MobileViT
          return self.forward_temporal(x=x[0], x_prev=x[1])
      elif isinstance(x, Tensor):
          # For image data
          return self.forward_spatial(x)
      else:
          raise NotImplementedError
  
imports: import math
  from typing import Dict, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.layers import ConvLayer2d, get_normalization_layer
  from cvnets.modules.base_module import BaseModule
  from cvnets.modules.transformer import LinearAttnFFN, TransformerEncoder
label_desc: Use image node_id 7 for calling the MobileViTBlock obj's underlying member method code with example usage: obj.forward(x) and returns: self, self