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 unfolding(self, feature_map: Tensor) -> Tuple[Tensor, Dict]:
      patch_w, patch_h = self.patch_w, self.patch_h
      patch_area = int(patch_w * patch_h)
      batch_size, in_channels, orig_h, orig_w = feature_map.shape
  
      new_h = int(math.ceil(orig_h / self.patch_h) * self.patch_h)
      new_w = int(math.ceil(orig_w / self.patch_w) * self.patch_w)
  
      interpolate = False
      if new_w != orig_w or new_h != orig_h:
          # Note: Padding can be done, but then it needs to be handled in attention function.
          feature_map = F.interpolate(
              feature_map,
              size=(new_h, new_w),
              mode="bilinear",
              align_corners=False,
          )
          interpolate = True
  
      # number of patches along width and height
      num_patch_w = new_w // patch_w  # n_w
      num_patch_h = new_h // patch_h  # n_h
      num_patches = num_patch_h * num_patch_w  # N
  
      # [B, C, H, W] --> [B * C * n_h, p_h, n_w, p_w]
      reshaped_fm = feature_map.reshape(
          batch_size * in_channels * num_patch_h,
          patch_h,
          num_patch_w,
          patch_w,
      )
      # [B * C * n_h, p_h, n_w, p_w] --> [B * C * n_h, n_w, p_h, p_w]
      transposed_fm = reshaped_fm.transpose(1, 2)
      # [B * C * n_h, n_w, p_h, p_w] --> [B, C, N, P] where P = p_h * p_w and N = n_h * n_w
      reshaped_fm = transposed_fm.reshape(
          batch_size, in_channels, num_patches, patch_area
      )
      # [B, C, N, P] --> [B, P, N, C]
      transposed_fm = reshaped_fm.transpose(1, 3)
      # [B, P, N, C] --> [BP, N, C]
      patches = transposed_fm.reshape(
          batch_size * patch_area, num_patches, -1
      )
  
      info_dict = {
          "orig_size": (orig_h, orig_w),
          "batch_size": batch_size,
          "interpolate": interpolate,
          "total_patches": num_patches,
          "num_patches_w": num_patch_w,
          "num_patches_h": num_patch_h,
      }
  
      return patches, info_dict
  
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 3 for calling the MobileViTBlock obj's underlying member method code with example usage: obj.unfolding(feature_map) and returns: patches,  info_dict