class_docstr: This class implements the inverted residual block, as described in `MobileNetv2 <https://arxiv.org/abs/1801.04381>`_ paper
  
  Args:
      in_channels (int): :math:`C_{in}` from an expected input of size :math:`(N, C_{in}, H_{in}, W_{in})`
      out_channels (int): :math:`C_{out}` from an expected output of size :math:`(N, C_{out}, H_{out}, W_{out)`
      stride (int): Use convolutions with a stride. Default: 1
      expand_ratio (Union[int, float]): Expand the input channels by this factor in depth-wise conv
      skip_connection (Optional[bool]): Use skip-connection. Default: True
  
  Shape:
      - Input: :math:`(N, C_{in}, H_{in}, W_{in})`
      - Output: :math:`(N, C_{out}, H_{out}, W_{out})`
  
  .. note::
      If `in_channels =! out_channels` and `stride > 1`, we set `skip_connection=False`
class_docstr_tok: ["This","class","implements","the","inverted","residual","block",",","as","described","in","`","MobileNetv2","<","https",":","\/\/arxiv.org\/abs\/1801.04381",">","`","_","paper","Args",":","in_channels","(","int",")",":",":","math",":","`","C_","{","in","}","`","from","an","expected","input","of","size",":","math",":","`","(","N",",","C_","{","in","}",",","H_","{","in","}",",","W_","{","in","}",")","`","out_channels","(","int",")",":",":","math",":","`","C_","{","out","}","`","from","an","expected","output","of","size",":","math",":","`","(","N",",","C_","{","out","}",",","H_","{","out","}",",","W_","{","out",")","`","stride","(","int",")",":","Use","convolutions","with","a","stride",".","Default",":","1","expand_ratio","(","Union","[","int",",","float","]",")",":","Expand","the","input","channels","by","this","factor","in","depth-wise","conv","skip_connection","(","Optional","[","bool","]",")",":","Use","skip-connection",".","Default",":","True","Shape",":","-","Input",":",":","math",":","`","(","N",",","C_","{","in","}",",","H_","{","in","}",",","W_","{","in","}",")","`","-","Output",":",":","math",":","`","(","N",",","C_","{","out","}",",","H_","{","out","}",",","W_","{","out","}",")","`","..","note",":",":","If","`","in_channels","=","!","out_channels","`","and","`","stride",">","1","`",",","we","set","`","skip_connection=False","`"]
code: def forward(self, x: Tensor, *args, **kwargs) -> Tensor:
      if self.use_res_connect:
          return x + self.block(x)
      else:
          return self.block(x)
  
imports: from typing import Optional, Tuple, Union, Dict
  import math
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import functional
  from transformer import TransformerEncoder
  from model_config import get_config
label_desc: Use image node_id 2 for calling the InvertedResidual obj's underlying member method code with example usage: obj.forward(x) and returns: unknown, self