class_docstr: Slowfast for ACAR-Net.
  
  Args:
      - block (`Bottleneck`):
          Bottleneck module.
      - layers (`tuple or list`):
          Number of layers at different stages.
      - alpha (`int`):
          The frame rate ratio between the Fast and Slow pathway.
      - beta (`float`):
          The ratio of channels of the Slow pathway.
      - fuse_only_conv (`bool`):
          Whether to use conv only to fuse pathways.
      - fuse_kernel_size (`int`):
          Kernel size used to fuse pathways.
      - slow_full_span (`bool`):
          Whether to span inputs for Slow pathway.
class_docstr_tok: ["Slowfast","for","ACAR-Net",".","Args",":","-","block","(","`","Bottleneck","`",")",":","Bottleneck","module",".","-","layers","(","`","tuple","or","list","`",")",":","Number","of","layers","at","different","stages",".","-","alpha","(","`","int","`",")",":","The","frame","rate","ratio","between","the","Fast","and","Slow","pathway",".","-","beta","(","`","float","`",")",":","The","ratio","of","channels","of","the","Slow","pathway",".","-","fuse_only_conv","(","`","bool","`",")",":","Whether","to","use","conv","only","to","fuse","pathways",".","-","fuse_kernel_size","(","`","int","`",")",":","Kernel","size","used","to","fuse","pathways",".","-","slow_full_span","(","`","bool","`",")",":","Whether","to","span","inputs","for","Slow","pathway","."]
code: def __init__(
      self,
      block,
      layers,
      alpha=8,
      beta=0.125,
      fuse_only_conv=True,
      fuse_kernel_size=5,
      slow_full_span=False,
  ):
      super().__init__()
  
      self.alpha = alpha
      self.beta = beta
      self.slow_full_span = slow_full_span
  
      # Fast Network
      self.fast_inplanes = int(64 * beta)
      self.fast_conv1 = nn.Conv3d(
          3,
          self.fast_inplanes,
          kernel_size=(5, 7, 7),
          stride=(1, 2, 2),
          padding=(2, 3, 3),
          bias=False,
      )
      self.fast_bn1 = BN(self.fast_inplanes)
      self.fast_relu = nn.ReLU(inplace=True)
      self.fast_maxpool = nn.MaxPool3d(
          kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 1, 1)
      )
  
      self.fast_res1 = self._make_layer_fast(
          block, int(64 * beta), layers[0], head_conv=3
      )
      self.fast_res2 = self._make_layer_fast(
          block, int(128 * beta), layers[1], stride=2, head_conv=3
      )
      self.fast_res3 = self._make_layer_fast(
          block, int(256 * beta), layers[2], stride=2, head_conv=3
      )
      self.fast_res4 = self._make_layer_fast(
          block, int(512 * beta), layers[3], head_conv=3, dilation=2
      )
  
      # Slow Network
      self.slow_inplanes = 64
      self.slow_conv1 = nn.Conv3d(
          3,
          self.slow_inplanes,
          kernel_size=(1, 7, 7),
          stride=(1, 2, 2),
          padding=(0, 3, 3),
          bias=False,
      )
      self.slow_bn1 = BN(self.slow_inplanes)
      self.slow_relu = nn.ReLU(inplace=True)
      self.slow_maxpool = nn.MaxPool3d(
          kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 1, 1)
      )
  
      self.slow_res1 = self._make_layer_slow(
          block, 64, layers[0], head_conv=1
      )
      self.slow_res2 = self._make_layer_slow(
          block, 128, layers[1], stride=2, head_conv=1
      )
      self.slow_res3 = self._make_layer_slow(
          block, 256, layers[2], stride=2, head_conv=3
      )
      self.slow_res4 = self._make_layer_slow(
          block, 512, layers[3], head_conv=3, dilation=2
      )
  
      # Lateral Connections
      fuse_padding = fuse_kernel_size // 2
      fuse_kwargs = {
          "kernel_size": (fuse_kernel_size, 1, 1),
          "stride": (alpha, 1, 1),
          "padding": (fuse_padding, 0, 0),
          "bias": False,
      }
      if fuse_only_conv:
  
          def fuse_func(in_channels, out_channels):
              return nn.Conv3d(in_channels, out_channels, **fuse_kwargs)
  
      else:
  
          def fuse_func(in_channels, out_channels):
              return nn.Sequential(
                  nn.Conv3d(in_channels, out_channels, **fuse_kwargs),
                  BN(out_channels),
                  nn.ReLU(inplace=True),
              )
  
      self.t_conv1 = fuse_func(int(64 * beta), int(128 * beta))
      self.t_conv2 = fuse_func(int(256 * beta), int(512 * beta))
      self.t_conv3 = fuse_func(int(512 * beta), int(1024 * beta))
      self.t_conv4 = fuse_func(int(1024 * beta), int(2048 * beta))
  
file_path: towhee/towhee/models/acar_net/backbone.py
imports: import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new SlowFast object from inherited base classes: nn with example: obj = SlowFast(block, layers, alpha, beta, fuse_only_conv, fuse_kernel_size, slow_full_span)