code: def _mobilenet_v3(
      arch: str,
      pretrained: bool,
      rect_strides: bool = False,
      **kwargs: Any,
  ) -> MobileNetV3:
      kwargs["num_classes"] = kwargs.get(
          "num_classes", len(default_cfgs[arch]["classes"])
      )
      kwargs["input_shape"] = kwargs.get(
          "input_shape", default_cfgs[arch]["input_shape"]
      )
      kwargs["classes"] = kwargs.get(
          "classes", default_cfgs[arch]["classes"]
      )
  
      _cfg = deepcopy(default_cfgs[arch])
      _cfg["num_classes"] = kwargs["num_classes"]
      _cfg["classes"] = kwargs["classes"]
      _cfg["input_shape"] = kwargs["input_shape"]
      kwargs.pop("classes")
  
      # cf. Table 1 & 2 of the paper
      if arch.startswith("mobilenet_v3_small"):
          inverted_residual_setting = [
              InvertedResidualConfig(
                  16, 3, 16, 16, True, "RE", 2
              ),  # C1
              InvertedResidualConfig(
                  16,
                  3,
                  72,
                  24,
                  False,
                  "RE",
                  (2, 1) if rect_strides else 2,
              ),  # C2
              InvertedResidualConfig(24, 3, 88, 24, False, "RE", 1),
              InvertedResidualConfig(
                  24,
                  5,
                  96,
                  40,
                  True,
                  "HS",
                  (2, 1) if rect_strides else 2,
              ),  # C3
              InvertedResidualConfig(40, 5, 240, 40, True, "HS", 1),
              InvertedResidualConfig(40, 5, 240, 40, True, "HS", 1),
              InvertedResidualConfig(40, 5, 120, 48, True, "HS", 1),
              InvertedResidualConfig(48, 5, 144, 48, True, "HS", 1),
              InvertedResidualConfig(
                  48,
                  5,
                  288,
                  96,
                  True,
                  "HS",
                  (2, 1) if rect_strides else 2,
              ),  # C4
              InvertedResidualConfig(96, 5, 576, 96, True, "HS", 1),
              InvertedResidualConfig(96, 5, 576, 96, True, "HS", 1),
          ]
          head_chans = 1024
      else:
          inverted_residual_setting = [
              InvertedResidualConfig(16, 3, 16, 16, False, "RE", 1),
              InvertedResidualConfig(
                  16, 3, 64, 24, False, "RE", 2
              ),  # C1
              InvertedResidualConfig(24, 3, 72, 24, False, "RE", 1),
              InvertedResidualConfig(
                  24,
                  5,
                  72,
                  40,
                  True,
                  "RE",
                  (2, 1) if rect_strides else 2,
              ),  # C2
              InvertedResidualConfig(40, 5, 120, 40, True, "RE", 1),
              InvertedResidualConfig(40, 5, 120, 40, True, "RE", 1),
              InvertedResidualConfig(
                  40,
                  3,
                  240,
                  80,
                  False,
                  "HS",
                  (2, 1) if rect_strides else 2,
              ),  # C3
              InvertedResidualConfig(80, 3, 200, 80, False, "HS", 1),
              InvertedResidualConfig(80, 3, 184, 80, False, "HS", 1),
              InvertedResidualConfig(80, 3, 184, 80, False, "HS", 1),
              InvertedResidualConfig(80, 3, 480, 112, True, "HS", 1),
              InvertedResidualConfig(112, 3, 672, 112, True, "HS", 1),
              InvertedResidualConfig(
                  112,
                  5,
                  672,
                  160,
                  True,
                  "HS",
                  (2, 1) if rect_strides else 2,
              ),  # C4
              InvertedResidualConfig(160, 5, 960, 160, True, "HS", 1),
              InvertedResidualConfig(160, 5, 960, 160, True, "HS", 1),
          ]
          head_chans = 1280
  
      kwargs["num_classes"] = _cfg["num_classes"]
      kwargs["input_shape"] = _cfg["input_shape"]
  
      # Build the model
      model = MobileNetV3(
          inverted_residual_setting,
          head_chans=head_chans,
          cfg=_cfg,
          **kwargs,
      )
      # Load pretrained parameters
      if pretrained:
          load_pretrained_params(model, default_cfgs[arch]["url"])
  
      return model
  
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.models import Sequential
  from ....datasets import VOCABS
  from ...utils import conv_sequence, load_pretrained_params
label_desc: Use image node_id 3 for calling a global function with example usage: _mobilenet_v3(arch, pretrained, rect_strides) and returns: model