class_docstr: This class defines the `MobileNet architecture <https://arxiv.org/abs/1704.04861>`_
class_docstr_tok: ["This","class","defines","the","`","MobileNet","architecture","<","https",":","\/\/arxiv.org\/abs\/1704.04861",">","`","_"]
code: def _make_layer(
      self,
      opts,
      mv1_config: Dict or List,
      input_channel: int,
      dilate: Optional[bool] = False,
      *args,
      **kwargs,
  ) -> Tuple[nn.Module, int]:
      prev_dilation = self.dilation
      mv1_block = []
  
      out_channels = mv1_config.get("out_channels")
      stride = mv1_config.get("stride", 1)
      n_repeat = mv1_config.get("repeat", 0)
  
      if stride == 2:
          if dilate:
              self.dilation *= stride
              stride = 1
  
          mv1_block.append(
              SeparableConv2d(
                  opts=opts,
                  in_channels=input_channel,
                  out_channels=out_channels,
                  kernel_size=3,
                  stride=stride,
                  use_norm=True,
                  use_act=True,
                  dilation=prev_dilation,
              ),
          )
          input_channel = out_channels
  
      for i in range(n_repeat):
          mv1_block.append(
              SeparableConv2d(
                  opts=opts,
                  in_channels=input_channel,
                  out_channels=out_channels,
                  kernel_size=3,
                  stride=1,
                  use_norm=True,
                  use_act=True,
                  dilation=self.dilation,
              ),
          )
          input_channel = out_channels
  
      return nn.Sequential(*mv1_block), input_channel
  
file_path: ml-cvnets/cvnets/models/classification/mobilenetv1.py
imports: import argparse
  from typing import Dict, List, Optional, Tuple
  from torch import nn
  from cvnets.layers import ConvLayer2d, Dropout, GlobalPool, Identity, LinearLayer, SeparableConv2d
  from cvnets.models import MODEL_REGISTRY
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.classification.config.mobilenetv1 import get_configuration
  from utils.math_utils import bound_fn
label_desc: Use image node_id 3 for calling the MobileNetv1 obj's underlying member method code with example usage: obj._make_layer(opts, mv1_config, input_channel, dilate) and returns: nn,  input_channel