code: def create_audio_visual_slowfast(
      *,
      # SlowFast configs.
      slowfast_channel_reduction_ratio: Tuple[int] = (8, 2),
      slowfast_conv_channel_fusion_ratio: int = 2,
      fusion_builder: Callable[
          [int, int], nn.Module
      ] = None,  # Args: fusion_dim_in, stage_idx
      # Input clip configs.
      input_channels: Tuple[int] = (3, 3, 1),
      # Model configs.
      model_depth: int = 50,
      model_num_class: int = 400,
      dropout_rate: float = 0.5,
      # Normalization configs.
      norm: Callable = nn.BatchNorm3d,
      # Activation configs.
      activation: Callable = nn.ReLU,
      # Stem configs.
      stem_dim_outs: Tuple[int] = (64, 8, 32),
      stem_conv_kernel_sizes: Tuple[Tuple[int]] = (
          (1, 7, 7),
          (5, 7, 7),
          (9, 1, 9),
      ),
      stem_conv_strides: Tuple[Tuple[int]] = (
          (1, 2, 2),
          (1, 2, 2),
          (1, 1, 1),
      ),
      stem_pool: Tuple[Callable] = (nn.MaxPool3d, nn.MaxPool3d, None),
      stem_pool_kernel_sizes: Tuple[Tuple[int]] = (
          (1, 3, 3),
          (1, 3, 3),
          (1, 3, 3),
      ),
      stem_pool_strides: Tuple[Tuple[int]] = (
          (1, 2, 2),
          (1, 2, 2),
          (1, 1, 1),
      ),
      # Stage configs.
      stage_conv_a_kernel_sizes: Tuple[Tuple[Tuple[int]]] = (
          ((1, 1, 1), (1, 1, 1), (3, 1, 1), (3, 1, 1)),
          ((3, 1, 1), (3, 1, 1), (3, 1, 1), (3, 1, 1)),
          ((1, 1, 1), (1, 1, 1), (1, 1, 1), (1, 1, 1)),
      ),
      stage_conv_b_kernel_sizes: Tuple[Tuple[Tuple[int]]] = (
          ((1, 3, 3), (1, 3, 3), (1, 3, 3), (1, 3, 3)),
          ((1, 3, 3), (1, 3, 3), (1, 3, 3), (1, 3, 3)),
          ((3, 1, 3), (3, 1, 3), (3, 1, 3), (3, 1, 3)),
      ),
      stage_conv_b_num_groups: Tuple[Tuple[int]] = (
          (1, 1, 1, 1),
          (1, 1, 1, 1),
          (1, 1, 1, 1),
      ),
      stage_conv_b_dilations: Tuple[Tuple[Tuple[int]]] = (
          ((1, 1, 1), (1, 1, 1), (1, 1, 1), (1, 1, 1)),
          ((1, 1, 1), (1, 1, 1), (1, 1, 1), (1, 1, 1)),
          ((1, 1, 1), (1, 1, 1), (1, 1, 1), (1, 1, 1)),
      ),
      stage_spatial_strides: Tuple[Tuple[int]] = (
          (1, 2, 2, 2),
          (1, 2, 2, 2),
          (1, 2, 2, 2),
      ),
      stage_temporal_strides: Tuple[Tuple[int]] = (
          (1, 1, 1, 1),
          (1, 1, 1, 1),
          (1, 2, 2, 2),
      ),
      bottleneck: Tuple[Tuple[Callable]] = (
          (
              create_bottleneck_block,
              create_bottleneck_block,
              create_bottleneck_block,
              create_bottleneck_block,
          ),
          (
              create_bottleneck_block,
              create_bottleneck_block,
              create_bottleneck_block,
              create_bottleneck_block,
          ),
          (
              create_acoustic_bottleneck_block,
              create_acoustic_bottleneck_block,
              create_bottleneck_block,
              create_bottleneck_block,
          ),
      ),
      # Head configs.
      head_pool: Callable = nn.AvgPool3d,
      head_pool_kernel_sizes: Tuple[Tuple[int]] = (
          (8, 7, 7),
          (32, 7, 7),
          (16, 1, 10),
      ),
      head_output_size: Tuple[int] = (1, 1, 1),
      head_activation: Callable = None,
      head_output_with_global_average: bool = True,
  ) -> nn.Module:
      """
      Model builder for AVSlowFast network.
      Fanyi Xiao, Yong Jae Lee, Kristen Grauman, Jitendra Malik, Christoph Feichtenhofer.
      "Audiovisual SlowFast Networks for Video Recognition."
      https://arxiv.org/abs/2001.08740
  
                               Slow Input  Fast Input  Audio Input
                                    ↓           ↓            ↓
                                   Stem       Stem         Stem
                                    ↓ ⭠ Fusion- ↓ ⭠ Fusion- ↓
                                 Stage 1     Stage 1      Stage 1
                                    ↓ ⭠ Fusion- ↓ ⭠ Fusion- ↓
                                    .            .           .
                                    ↓            ↓           ↓
                                 Stage N      Stage N     Stage N
                                    ↓ ⭠ Fusion- ↓ ⭠ Fusion- ↓
                                           ↓
                                         Head
  
      Args:
          SlowFast configs:
              slowfast_channel_reduction_ratio (int): Corresponds to the inverse of the channel
                  reduction ratio, $\beta$F between the Slow and Fast pathways.
              slowfast_audio_reduction_ratio (int): Corresponds to the inverse of the channel
                  reduction ratio, $\beta$A between the Slow and Audio pathways.
              slowfast_conv_channel_fusion_ratio (int): Ratio of channel dimensions
                  between the Slow and Fast pathways.
              fusion_builder (Callable[[int, int], nn.Module]): Builder function for generating
                  the fusion modules based on stage dimension and index
  
          Input clip configs:
              input_channels (tuple): number of channels for the input video clip.
  
          Model configs:
              model_depth (int): the depth of the resnet.
              model_num_class (int): the number of classes for the video dataset.
              dropout_rate (float): dropout rate.
  
          Normalization configs:
              norm (callable): a callable that constructs normalization layer.
  
          Activation configs:
              activation (callable): a callable that constructs activation layer.
  
          Stem configs:
              stem_function (Tuple[Callable]): a callable that constructs stem layer.
                  Examples include create_res_basic_stem. Indexed by pathway
              stem_dim_outs (tuple): output channel size to stem.
              stem_conv_kernel_sizes (tuple): convolutional kernel size(s) of stem.
              stem_conv_strides (tuple): convolutional stride size(s) of stem.
              stem_pool (Tuple[Callable]): a callable that constructs resnet head pooling layer.
                  Indexed by pathway
              stem_pool_kernel_sizes (tuple): pooling kernel size(s).
              stem_pool_strides (tuple): pooling stride size(s).
  
          Stage configs:
              stage_conv_a_kernel_sizes (tuple): convolutional kernel size(s) for conv_a.
              stage_conv_b_kernel_sizes (tuple): convolutional kernel size(s) for conv_b.
              stage_conv_b_num_groups (tuple): number of groups for groupwise convolution
                  for conv_b. 1 for ResNet, and larger than 1 for ResNeXt.
              stage_conv_b_dilations (tuple): dilation for 3D convolution for conv_b.
              stage_spatial_strides (tuple): the spatial stride for each stage.
              stage_temporal_strides (tuple): the temporal stride for each stage.
              bottleneck (Tuple[Tuple[Callable]]): a callable that constructs bottleneck
                  block layer. Examples include: create_bottleneck_block.
                  Indexed by pathway and stage index
  
          Head configs:
              head_pool (callable): a callable that constructs resnet head pooling layer.
              head_output_sizes (tuple): the size of output tensor for head.
              head_activation (callable): a callable that constructs activation layer.
              head_output_with_global_average (bool): if True, perform global averaging on
                  the head output.
      Returns:
          (nn.Module): SlowFast model.
      """
  
      torch._C._log_api_usage_once(
          "PYTORCHVIDEO.model.create_audio_visual_slowfast"
      )
  
      # Number of blocks for different stages given the model depth.
      # 3 pathways, first is slow, second is fast, third is audio
      if fusion_builder is None:
          fusion_builder = AudioToSlowFastFusionBuilder(
              slowfast_channel_reduction_ratio=slowfast_channel_reduction_ratio[
                  0
              ],
              slowfast_audio_reduction_ratio=slowfast_channel_reduction_ratio[
                  1
              ],
              conv_fusion_channel_ratio=slowfast_conv_channel_fusion_ratio,
              conv_kernel_size=(7, 1, 1),
              conv_kernel_size_a=(5, 1, 1),
              conv_stride=(4, 1, 1),
              conv_stride_a=(
                  (16, 1, 1),
                  (16, 1, 1),
                  (8, 1, 1),
                  (4, 1, 1),
                  (2, 1, 1),
              ),
              norm=norm,
              activation=activation,
          ).create_module
  
      return create_slowfast(
          slowfast_channel_reduction_ratio=slowfast_channel_reduction_ratio,
          slowfast_conv_channel_fusion_ratio=slowfast_conv_channel_fusion_ratio,
          fusion_builder=fusion_builder,
          # Input clip configs.
          input_channels=input_channels,
          # Model configs.
          model_depth=model_depth,
          model_num_class=model_num_class,
          dropout_rate=dropout_rate,
          # Normalization configs.
          norm=norm,
          # Activation configs.
          activation=activation,
          # Stem configs.
          stem_function=(
              create_res_basic_stem,
              create_res_basic_stem,
              create_acoustic_res_basic_stem,
          ),
          stem_dim_outs=stem_dim_outs,
          stem_conv_kernel_sizes=stem_conv_kernel_sizes,
          stem_conv_strides=stem_conv_strides,
          stem_pool=stem_pool,
          stem_pool_kernel_sizes=stem_pool_kernel_sizes,
          stem_pool_strides=stem_pool_strides,
          # Stage configs.
          stage_conv_a_kernel_sizes=stage_conv_a_kernel_sizes,
          stage_conv_b_kernel_sizes=stage_conv_b_kernel_sizes,
          stage_conv_b_num_groups=stage_conv_b_num_groups,
          stage_conv_b_dilations=stage_conv_b_dilations,
          stage_spatial_strides=stage_spatial_strides,
          stage_temporal_strides=stage_temporal_strides,
          bottleneck=bottleneck,
          # Head configs.
          head_pool=head_pool,
          head_pool_kernel_sizes=head_pool_kernel_sizes,
          head_output_size=head_output_size,
          head_activation=head_activation,
          head_output_with_global_average=head_output_with_global_average,
      )
  
file_path: pytorchvideo/pytorchvideo/models/audio_visual_slowfast.py
imports: from typing import Callable, Tuple, Union
  import torch
  import torch.nn
  from pytorchvideo.layers.utils import set_attributes
  from pytorchvideo.models.resnet import create_acoustic_bottleneck_block, create_bottleneck_block
  from pytorchvideo.models.slowfast import create_slowfast
  from pytorchvideo.models.stem import create_acoustic_res_basic_stem, create_res_basic_stem
label_desc: Use image node_id 1 for calling a global function with example usage: create_audio_visual_slowfast() and returns: create_slowfast