code: def _inverted_res_block(
      x,
      input_c: int,  # input channel
      kernel_size: int,  # kennel size
      exp_c: int,  # expanded channel
      out_c: int,  # out channel
      use_se: bool,  # whether using SE
      activation: str,  # RE or HS
      stride: int,
      block_id: int,
      alpha: float = 1.0,
  ):
      bn = partial(
          layers.BatchNormalization, epsilon=0.001, momentum=0.99
      )
  
      input_c = _make_divisible(input_c * alpha)
      exp_c = _make_divisible(exp_c * alpha)
      out_c = _make_divisible(out_c * alpha)
  
      act = layers.ReLU if activation == "RE" else HardSwish
  
      shortcut = x
      prefix = "expanded_conv/"
      if block_id:
          # expand channel
          prefix = "expanded_conv_{}/".format(block_id)
          x = layers.Conv2D(
              filters=exp_c,
              kernel_size=1,
              padding="same",
              use_bias=False,
              name=prefix + "expand",
          )(x)
          x = bn(name=prefix + "expand/BatchNorm")(x)
          x = act(name=prefix + "expand/" + act.__name__)(x)
  
      if stride == 2:
          input_size = (x.shape[1], x.shape[2])  # height, width
          x = layers.ZeroPadding2D(
              padding=correct_pad(input_size, kernel_size),
              name=prefix + "depthwise/pad",
          )(x)
  
      x = layers.DepthwiseConv2D(
          kernel_size=kernel_size,
          strides=stride,
          padding="same" if stride == 1 else "valid",
          use_bias=False,
          name=prefix + "depthwise",
      )(x)
      x = bn(name=prefix + "depthwise/BatchNorm")(x)
      x = act(name=prefix + "depthwise/" + act.__name__)(x)
  
      if use_se:
          x = _se_block(x, filters=exp_c, prefix=prefix)
  
      x = layers.Conv2D(
          filters=out_c,
          kernel_size=1,
          padding="same",
          use_bias=False,
          name=prefix + "project",
      )(x)
      x = bn(name=prefix + "project/BatchNorm")(x)
  
      if stride == 1 and input_c == out_c:
          x = layers.Add(name=prefix + "Add")([shortcut, x])
  
      return x
  
file_path: deep-learning-for-image-processing/tensorflow_classification/Test6_mobilenet/model_v3.py
imports: from typing import Union
  from functools import partial
  from tensorflow.keras import layers, Model
label_desc: Use image node_id 4 for calling a global function with example usage: _inverted_res_block(x, input_c, kernel_size, exp_c, out_c, use_se, activation, stride, block_id, alpha) and returns: x