class_docstr: Mobile Inverted Residual Bottleneck Block.
  
  Args:
      block_args (namedtuple): BlockArgs, defined in utils.py.
      global_params (namedtuple): GlobalParam, defined in utils.py.
      image_size (tuple or list): [image_height, image_width].
  
  References:
      [1] https://arxiv.org/abs/1704.04861 (MobileNet v1)
      [2] https://arxiv.org/abs/1801.04381 (MobileNet v2)
      [3] https://arxiv.org/abs/1905.02244 (MobileNet v3)
class_docstr_tok: ["Mobile","Inverted","Residual","Bottleneck","Block",".","Args",":","block_args","(","namedtuple",")",":","BlockArgs",",","defined","in","utils.py",".","global_params","(","namedtuple",")",":","GlobalParam",",","defined","in","utils.py",".","image_size","(","tuple","or","list",")",":","[","image_height",",","image_width","]",".","References",":","[","1","]","https",":","\/\/arxiv.org\/abs\/1704.04861","(","MobileNet","v1",")","[","2","]","https",":","\/\/arxiv.org\/abs\/1801.04381","(","MobileNet","v2",")","[","3","]","https",":","\/\/arxiv.org\/abs\/1905.02244","(","MobileNet","v3",")"]
docstr: MBConvBlock's forward function.
  
  Args:
      inputs (tensor): Input tensor.
      drop_connect_rate (bool): Drop connect rate (float, between 0 and 1).
  
  Returns:
      Output of this block after processing.
docstr_tok: ["MBConvBlock","'s","forward","function",".","Args",":","inputs","(","tensor",")",":","Input","tensor",".","drop_connect_rate","(","bool",")",":","Drop","connect","rate","(","float",",","between","0","and","1",")",".","Returns",":","Output","of","this","block","after","processing","."]
code: def forward(self, inputs, drop_connect_rate=None):
      """MBConvBlock's forward function.
  
      Args:
          inputs (tensor): Input tensor.
          drop_connect_rate (bool): Drop connect rate (float, between 0 and 1).
  
      Returns:
          Output of this block after processing.
      """
  
      # Expansion and Depthwise Convolution
      x = inputs
      if self._block_args.expand_ratio != 1:
          x = self._expand_conv(inputs)
          x = self._bn0(x)
          x = self._swish(x)
  
      x = self._depthwise_conv(x)
      x = self._bn1(x)
      x = self._swish(x)
  
      # Squeeze and Excitation
      if self.has_se:
          x_squeezed = F.adaptive_avg_pool2d(x, 1)
          x_squeezed = self._se_reduce(x_squeezed)
          x_squeezed = self._swish(x_squeezed)
          x_squeezed = self._se_expand(x_squeezed)
          x = torch.sigmoid(x_squeezed) * x
  
      # Pointwise Convolution
      x = self._project_conv(x)
      x = self._bn2(x)
  
      # Skip connection and drop connect
      input_filters, output_filters = (
          self._block_args.input_filters,
          self._block_args.output_filters,
      )
      if (
          self.id_skip
          and self._block_args.stride == 1
          and input_filters == output_filters
      ):
          # The combination of skip connection and drop connect brings about stochastic depth.
          if drop_connect_rate:
              x = drop_connect(
                  x, p=drop_connect_rate, training=self.training
              )
          x = x + inputs  # skip connection
      return x
  
imports: import torch
  from torch import nn
  from torch.nn import functional
  from .utils import round_filters, round_repeats, drop_connect, get_same_padding_conv2d, get_model_params, efficientnet_params, load_pretrained_weights, Swish, MemoryEfficientSwish, calculate_output_image_size
label_desc: Use image node_id 2 for calling the MBConvBlock obj's underlying member method code with example usage: obj.forward(inputs, drop_connect_rate) and returns: x