class_docstr: SlowFast networks (SlowFast) from
  `"SlowFast Networks for Video Recognition"
  <https://arxiv.org/abs/1812.03982>`_ paper.
code: def __init__(
      self,
      num_classes,
      block=Bottleneck,
      layers=None,
      num_block_temp_kernel_fast=None,
      num_block_temp_kernel_slow=None,
      pretrained=False,
      pretrained_base=False,
      feat_ext=False,
      num_segment=1,
      num_crop=1,
      bn_eval=True,
      bn_frozen=False,
      partial_bn=False,
      frozen_stages=-1,
      dropout_ratio=0.5,
      init_std=0.01,
      alpha=8,
      beta_inv=8,
      fusion_conv_channel_ratio=2,
      fusion_kernel_size=5,
      width_per_group=64,
      num_groups=1,
      slow_temporal_stride=16,
      fast_temporal_stride=2,
      slow_frames=4,
      fast_frames=32,
      norm_layer=BatchNorm3d,
      norm_kwargs=None,
      ctx=None,
      **kwargs,
  ):
      super(SlowFast, self).__init__()
      self.num_segment = num_segment
      self.num_crop = num_crop
      self.dropout_ratio = dropout_ratio
      self.init_std = init_std
      self.alpha = alpha
      self.beta_inv = beta_inv
      self.fusion_conv_channel_ratio = fusion_conv_channel_ratio
      self.fusion_kernel_size = fusion_kernel_size
      self.width_per_group = width_per_group
      self.num_groups = num_groups
      self.dim_inner = self.num_groups * self.width_per_group
      self.out_dim_ratio = (
          self.beta_inv // self.fusion_conv_channel_ratio
      )
      self.slow_temporal_stride = slow_temporal_stride
      self.fast_temporal_stride = fast_temporal_stride
      self.slow_frames = slow_frames
      self.fast_frames = fast_frames
      self.feat_ext = feat_ext
  
      # build fast pathway
      self.fast_conv1 = nn.Conv3d(
          in_channels=3,
          out_channels=self.width_per_group // self.beta_inv,
          kernel_size=(5, 7, 7),
          stride=(1, 2, 2),
          padding=(2, 3, 3),
          bias=False,
      )
      self.fast_bn1 = norm_layer(
          num_features=self.width_per_group // self.beta_inv,
          **({} if norm_kwargs is None else norm_kwargs),
      )
      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_res2 = self._make_layer_fast(
          inplanes=self.width_per_group // self.beta_inv,
          planes=self.dim_inner // self.beta_inv,
          num_blocks=layers[0],
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="fast_res2_",
      )
      self.fast_res3 = self._make_layer_fast(
          inplanes=self.width_per_group * 4 // self.beta_inv,
          planes=self.dim_inner * 2 // self.beta_inv,
          num_blocks=layers[1],
          strides=2,
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="fast_res3_",
      )
      self.fast_res4 = self._make_layer_fast(
          inplanes=self.width_per_group * 8 // self.beta_inv,
          planes=self.dim_inner * 4 // self.beta_inv,
          num_blocks=layers[2],
          num_block_temp_kernel_fast=num_block_temp_kernel_fast,
          strides=2,
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="fast_res4_",
      )
      self.fast_res5 = self._make_layer_fast(
          inplanes=self.width_per_group * 16 // self.beta_inv,
          planes=self.dim_inner * 8 // self.beta_inv,
          num_blocks=layers[3],
          strides=2,
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="fast_res5_",
      )
  
      # build lateral connections
      self.lateral_p1 = nn.Sequential(
          nn.Conv3d(
              in_channels=self.width_per_group // self.beta_inv,
              out_channels=self.width_per_group
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              kernel_size=(self.fusion_kernel_size, 1, 1),
              stride=(self.alpha, 1, 1),
              padding=(self.fusion_kernel_size // 2, 0, 0),
              bias=False,
          ),
          norm_layer(
              num_features=self.width_per_group
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              **({} if norm_kwargs is None else norm_kwargs),
          ),
          nn.ReLU(inplace=True),
      )
  
      self.lateral_res2 = nn.Sequential(
          nn.Conv3d(
              in_channels=self.width_per_group * 4 // self.beta_inv,
              out_channels=self.width_per_group
              * 4
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              kernel_size=(self.fusion_kernel_size, 1, 1),
              stride=(self.alpha, 1, 1),
              padding=(self.fusion_kernel_size // 2, 0, 0),
              bias=False,
          ),
          norm_layer(
              num_features=self.width_per_group
              * 4
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              **({} if norm_kwargs is None else norm_kwargs),
          ),
          nn.ReLU(inplace=True),
      )
  
      self.lateral_res3 = nn.Sequential(
          nn.Conv3d(
              in_channels=self.width_per_group * 8 // self.beta_inv,
              out_channels=self.width_per_group
              * 8
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              kernel_size=(self.fusion_kernel_size, 1, 1),
              stride=(self.alpha, 1, 1),
              padding=(self.fusion_kernel_size // 2, 0, 0),
              bias=False,
          ),
          norm_layer(
              num_features=self.width_per_group
              * 8
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              **({} if norm_kwargs is None else norm_kwargs),
          ),
          nn.ReLU(inplace=True),
      )
  
      self.lateral_res4 = nn.Sequential(
          nn.Conv3d(
              in_channels=self.width_per_group * 16 // self.beta_inv,
              out_channels=self.width_per_group
              * 16
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              kernel_size=(self.fusion_kernel_size, 1, 1),
              stride=(self.alpha, 1, 1),
              padding=(self.fusion_kernel_size // 2, 0, 0),
              bias=False,
          ),
          norm_layer(
              num_features=self.width_per_group
              * 16
              // self.beta_inv
              * self.fusion_conv_channel_ratio,
              **({} if norm_kwargs is None else norm_kwargs),
          ),
          nn.ReLU(inplace=True),
      )
  
      # build slow pathway
      self.slow_conv1 = nn.Conv3d(
          in_channels=3,
          out_channels=self.width_per_group,
          kernel_size=(1, 7, 7),
          stride=(1, 2, 2),
          padding=(0, 3, 3),
          bias=False,
      )
      self.slow_bn1 = norm_layer(
          num_features=self.width_per_group,
          **({} if norm_kwargs is None else norm_kwargs),
      )
      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_res2 = self._make_layer_slow(
          inplanes=self.width_per_group
          + self.width_per_group // self.out_dim_ratio,
          planes=self.dim_inner,
          num_blocks=layers[0],
          head_conv=1,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="slow_res2_",
      )
      self.slow_res3 = self._make_layer_slow(
          inplanes=self.width_per_group * 4
          + self.width_per_group * 4 // self.out_dim_ratio,
          planes=self.dim_inner * 2,
          num_blocks=layers[1],
          strides=2,
          head_conv=1,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="slow_res3_",
      )
      self.slow_res4 = self._make_layer_slow(
          inplanes=self.width_per_group * 8
          + self.width_per_group * 8 // self.out_dim_ratio,
          planes=self.dim_inner * 4,
          num_blocks=layers[2],
          num_block_temp_kernel_slow=num_block_temp_kernel_slow,
          strides=2,
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="slow_res4_",
      )
      self.slow_res5 = self._make_layer_slow(
          inplanes=self.width_per_group * 16
          + self.width_per_group * 16 // self.out_dim_ratio,
          planes=self.dim_inner * 8,
          num_blocks=layers[3],
          strides=2,
          head_conv=3,
          norm_layer=norm_layer,
          norm_kwargs=norm_kwargs,
          layer_name="slow_res5_",
      )
  
      # build classifier
      self.avg = nn.AdaptiveAvgPool3d(1)
      self.dp = nn.Dropout(p=self.dropout_ratio)
      self.feat_dim = (
          self.width_per_group * 32 // self.beta_inv
          + self.width_per_group * 32
      )
      self.fc = nn.Linear(
          in_features=self.feat_dim, out_features=num_classes, bias=True
      )
  
imports: import torch
  import torch.nn
  from torch.nn import BatchNorm3d
label_desc: Use image node_id 1 to create a new SlowFast object from inherited base classes: nn with example: obj = SlowFast(num_classes, block, layers, num_block_temp_kernel_fast, num_block_temp_kernel_slow, pretrained, pretrained_base, feat_ext, num_segment, num_crop, bn_eval, bn_frozen, partial_bn, frozen_stages, dropout_ratio, init_std, alpha, beta_inv, fusion_conv_channel_ratio, fusion_kernel_size, width_per_group, num_groups, slow_temporal_stride, fast_temporal_stride, slow_frames, fast_frames, norm_layer, norm_kwargs, ctx)