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_temporal(
      self, x: Tensor, x_prev: Optional[Tensor] = None
  ) -> Union[Tensor, Tuple[Tensor, Tensor]]:
      res = x
      fm = self.local_rep(x)
  
      # convert feature map to patches
      patches, info_dict = self.unfolding(fm)
  
      # learn global representations
      for global_layer in self.global_rep:
          if isinstance(global_layer, TransformerEncoder):
              patches = global_layer(x=patches, x_prev=x_prev)
          else:
              patches = global_layer(patches)
  
      # [B x Patch x Patches x C] --> [B x C x Patches x Patch]
      fm = self.folding(patches=patches, info_dict=info_dict)
  
      fm = self.conv_proj(fm)
  
      if self.fusion is not None:
          fm = self.fusion(torch.cat((res, fm), dim=1))
      return fm, patches
  
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 6 for calling the MobileViTBlock obj's underlying member method code with example usage: obj.forward_temporal(x, x_prev) and returns: fm,  patches