class_docstr: Mobile Inverted Residual Bottleneck Block.
class_docstr_tok: ["Mobile","Inverted","Residual","Bottleneck","Block","."]
code: def forward(self, inputs, drop_connect_rate=None):
      # Expansion and Depthwise Convolution
      if self.expand_ratio != 1:
          x = self.relu_fn(self.bn0(self.expand_conv(inputs)))
      else:
          x = inputs
  
      x = self.relu_fn(self.bn1(self.depthwise_conv(x)))
  
      # Squeeze and Excitation
      if self.has_se:
          # squeeze x in the spatial dimensions
          x_squeezed = self.se_avgpool(x)
          x_expanded = self.se_expand(
              self.relu_fn(self.se_reduce(x_squeezed))
          )
          x = torch.sigmoid(x_expanded) * x
  
      x = self.bn2(self.project_conv(x))
  
      # Skip connection and Drop Connect
      if self.id_skip:
          if (
              self.stride == 1
              and self.input_filters == self.output_filters
          ):
              # only apply drop connect if a skip connection is present
              if drop_connect_rate:
                  x = drop_connect(x, self.training, drop_connect_rate)
              x = x + inputs
      return x
  
imports: import copy
  import math
  from collections import OrderedDict
  from typing import Any, Dict, NamedTuple, Optional
  import torch
  import torch.nn
  from classy_vision.generic.util import get_torch_version
  from classy_vision.models import ClassyModel, register_model
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