class_docstr: This class defines the `MobileNetv2 architecture <https://arxiv.org/abs/1801.04381>`_
code: def _make_layer(
      self,
      opts,
      mv2_config: Dict or List,
      width_mult: float,
      input_channel: int,
      dilate: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Tuple[nn.Module, int]:
      prev_dilation = self.dilation
      mv2_block = nn.Sequential()
      count = 0
  
      if isinstance(mv2_config, Dict):
          mv2_config = [mv2_config]
  
      for cfg in mv2_config:
          t = cfg.get("expansion_ratio")
          c = cfg.get("out_channels")
          n = cfg.get("num_blocks")
          s = cfg.get("stride")
  
          output_channel = make_divisible(
              c * width_mult, self.round_nearest
          )
  
          for block_idx in range(n):
              stride = s if block_idx == 0 else 1
              block_name = "mv2_block_{}".format(count)
              if dilate and count == 0:
                  self.dilation *= stride
                  stride = 1
  
              layer = InvertedResidual(
                  opts=opts,
                  in_channels=input_channel,
                  out_channels=output_channel,
                  stride=stride,
                  expand_ratio=t,
                  dilation=prev_dilation
                  if count == 0
                  else self.dilation,
              )
              mv2_block.add_module(name=block_name, module=layer)
              count += 1
              input_channel = output_channel
      return mv2_block, input_channel
  
file_path: ml-cvnets/cvnets/models/classification/mobilenetv2.py
imports: import argparse
  from typing import Dict, List, 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.mobilenetv2 import get_configuration
  from cvnets.modules import InvertedResidual
  from utils.math_utils import bound_fn, make_divisible
label_desc: Use image node_id 3 for calling the MobileNetV2 obj's underlying member method code with example usage: obj._make_layer(opts, mv2_config, width_mult, input_channel, dilate) and returns: mv2_block,  input_channel