class_docstr: This class implements the `MobileViT architecture <https://arxiv.org/abs/2110.02178?context=cs.LG>`_
code: def _make_mit_layer(
      self,
      opts,
      input_channel,
      cfg: Dict,
      dilate: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Tuple[nn.Sequential, int]:
      prev_dilation = self.dilation
      block = []
      stride = cfg.get("stride", 1)
  
      if stride == 2:
          if dilate:
              self.dilation *= 2
              stride = 1
  
          layer = InvertedResidual(
              opts=opts,
              in_channels=input_channel,
              out_channels=cfg.get("out_channels"),
              stride=stride,
              expand_ratio=cfg.get("mv_expand_ratio", 4),
              dilation=prev_dilation,
          )
  
          block.append(layer)
          input_channel = cfg.get("out_channels")
  
      head_dim = cfg.get("head_dim", 32)
      transformer_dim = cfg["transformer_channels"]
      ffn_dim = cfg.get("ffn_dim")
      if head_dim is None:
          num_heads = cfg.get("num_heads", 4)
          if num_heads is None:
              num_heads = 4
          head_dim = transformer_dim // num_heads
  
      if transformer_dim % head_dim != 0:
          logger.error(
              "Transformer input dimension should be divisible by head dimension. "
              "Got {} and {}.".format(transformer_dim, head_dim)
          )
  
      block.append(
          MobileViTBlock(
              opts=opts,
              in_channels=input_channel,
              transformer_dim=transformer_dim,
              ffn_dim=ffn_dim,
              n_transformer_blocks=cfg.get("transformer_blocks", 1),
              patch_h=cfg.get("patch_h", 2),
              patch_w=cfg.get("patch_w", 2),
              dropout=getattr(
                  opts, "model.classification.mit.dropout", 0.1
              ),
              ffn_dropout=getattr(
                  opts, "model.classification.mit.ffn_dropout", 0.0
              ),
              attn_dropout=getattr(
                  opts, "model.classification.mit.attn_dropout", 0.1
              ),
              head_dim=head_dim,
              no_fusion=getattr(
                  opts,
                  "model.classification.mit.no_fuse_local_global_features",
                  False,
              ),
              conv_ksize=getattr(
                  opts, "model.classification.mit.conv_kernel_size", 3
              ),
          )
      )
  
      return nn.Sequential(*block), input_channel
  
file_path: ml-cvnets/cvnets/models/classification/mobilevit.py
imports: import argparse
  from typing import Dict, Optional, Tuple
  from torch import nn
  from cvnets.layers import ConvLayer2d, Dropout, GlobalPool, LinearLayer
  from cvnets.models import MODEL_REGISTRY
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.classification.config.mobilevit import get_configuration
  from cvnets.modules import InvertedResidual, MobileViTBlock
  from utils import logger
label_desc: Use image node_id 5 for calling the MobileViT obj's underlying member method code with example usage: obj._make_mit_layer(opts, input_channel, cfg, dilate) and returns: nn,  input_channel