code: def __init__(
      self,
      inverted_residual_setting: List[InvertedResidualConfig],
      last_channel: int,
      num_classes: int = 1000,
      block: Optional[Callable[..., nn.Module]] = None,
      norm_layer: Optional[Callable[..., nn.Module]] = None,
  ):
      super(MobileNetV3, self).__init__()
  
      if not inverted_residual_setting:
          raise ValueError(
              "The inverted_residual_setting should not be empty."
          )
      elif not (
          isinstance(inverted_residual_setting, List)
          and all(
              [
                  isinstance(s, InvertedResidualConfig)
                  for s in inverted_residual_setting
              ]
          )
      ):
          raise TypeError(
              "The inverted_residual_setting should be List[InvertedResidualConfig]"
          )
  
      if block is None:
          block = InvertedResidual
  
      if norm_layer is None:
          norm_layer = partial(nn.BatchNorm2d, eps=0.001, momentum=0.01)
  
      layers: List[nn.Module] = []
  
      # building first layer
      firstconv_output_c = inverted_residual_setting[0].input_c
      layers.append(
          ConvBNActivation(
              3,
              firstconv_output_c,
              kernel_size=3,
              stride=2,
              norm_layer=norm_layer,
              activation_layer=nn.Hardswish,
          )
      )
      # building inverted residual blocks
      for cnf in inverted_residual_setting:
          layers.append(block(cnf, norm_layer))
  
      # building last several layers
      lastconv_input_c = inverted_residual_setting[-1].out_c
      lastconv_output_c = 6 * lastconv_input_c
      layers.append(
          ConvBNActivation(
              lastconv_input_c,
              lastconv_output_c,
              kernel_size=1,
              norm_layer=norm_layer,
              activation_layer=nn.Hardswish,
          )
      )
      self.features = nn.Sequential(*layers)
      self.avgpool = nn.AdaptiveAvgPool2d(1)
      self.classifier = nn.Sequential(
          nn.Linear(lastconv_output_c, last_channel),
          nn.Hardswish(inplace=True),
          nn.Dropout(p=0.2, inplace=True),
          nn.Linear(last_channel, num_classes),
      )
  
      # initial weights
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              nn.init.kaiming_normal_(m.weight, mode="fan_out")
              if m.bias is not None:
                  nn.init.zeros_(m.bias)
          elif isinstance(m, (nn.BatchNorm2d, nn.GroupNorm)):
              nn.init.ones_(m.weight)
              nn.init.zeros_(m.bias)
          elif isinstance(m, nn.Linear):
              nn.init.normal_(m.weight, 0, 0.01)
              nn.init.zeros_(m.bias)
  
imports: from typing import Callable, List, Optional
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
  from functools import partial
label_desc: Use image node_id 1 to create a new MobileNetV3 object from inherited base classes: nn with example: obj = MobileNetV3(inverted_residual_setting, last_channel, num_classes, block, norm_layer)