class_docstr: This class implements the `MobileNetv3 architecture <https://arxiv.org/abs/1905.02244>`_
class_docstr_tok: ["This","class","implements","the","`","MobileNetv3","architecture","<","https",":","\/\/arxiv.org\/abs\/1905.02244",">","`","_"]
code: def _make_layer(
      self,
      opts,
      mv3_config,
      width_mult: float,
      input_channel: int,
      dilate: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Tuple[nn.Module, int]:
      prev_dilation = self.dilation
      mv3_block = nn.Sequential()
      count = 0
  
      for i in range(len(mv3_config)):
          for (
              kernel_size,
              expansion_factor,
              in_channels,
              use_se,
              use_hs,
              stride,
          ) in [mv3_config[i]]:
              block_name = "mv3_s_{}_idx_{}".format(stride, count)
              output_channel = make_divisible(
                  in_channels * width_mult, self.round_nearest
              )
  
              if dilate and count == 0:
                  self.dilation *= stride
                  stride = 1
  
              layer = InvertedResidualSE(
                  opts=opts,
                  in_channels=input_channel,
                  out_channels=output_channel,
                  stride=stride,
                  expand_ratio=expansion_factor,
                  dilation=prev_dilation
                  if count == 0
                  else self.dilation,
                  act_fn_name="hard_swish" if use_hs else "relu",
                  use_se=use_se,
              )
              mv3_block.add_module(name=block_name, module=layer)
              count += 1
              input_channel = output_channel
      return mv3_block, input_channel
  
file_path: ml-cvnets/cvnets/models/classification/mobilenetv3.py
imports: import argparse
  from typing import Optional, Tuple
  from torch import nn
  from cvnets.layers import ConvLayer2d, Dropout, GlobalPool, LinearLayer
  from cvnets.layers.activation import build_activation_layer
  from cvnets.models import MODEL_REGISTRY
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.classification.config.mobilenetv3 import get_configuration
  from cvnets.modules import InvertedResidualSE
  from utils.math_utils import bound_fn, make_divisible
label_desc: Use image node_id 2 for calling the MobileNetV3 obj's underlying member method code with example usage: obj._make_layer(opts, mv3_config, width_mult, input_channel, dilate) and returns: mv3_block,  input_channel