class_docstr: CSN models using PyTorchVideo model builder.
class_docstr_tok: ["CSN","models","using","PyTorchVideo","model","builder","."]
docstr: Builds a single pathway ResNet model.
  
  Args:
      cfg (CfgNode): model building configs, details are in the
          comments of the config file.
code: def _construct_network(self, cfg):
      """
      Builds a single pathway ResNet model.
  
      Args:
          cfg (CfgNode): model building configs, details are in the
              comments of the config file.
      """
  
      # Params from configs.
      norm_module = get_norm(cfg)
  
      self.model = create_csn(
          # Input clip configs.
          input_channel=cfg.DATA.INPUT_CHANNEL_NUM[0],
          # Model configs.
          model_depth=cfg.RESNET.DEPTH,
          model_num_class=cfg.MODEL.NUM_CLASSES,
          dropout_rate=cfg.MODEL.DROPOUT_RATE,
          # Normalization configs.
          norm=norm_module,
          # Activation configs.
          activation=partial(nn.ReLU, inplace=cfg.RESNET.INPLACE_RELU),
          # Stem configs.
          stem_dim_out=cfg.RESNET.WIDTH_PER_GROUP,
          stem_conv_kernel_size=(3, 7, 7),
          stem_conv_stride=(1, 2, 2),
          stem_pool=nn.MaxPool3d,
          stem_pool_kernel_size=(1, 3, 3),
          stem_pool_stride=(1, 2, 2),
          # Stage configs.
          stage_conv_a_kernel_size=(1, 1, 1),
          stage_conv_b_kernel_size=(3, 3, 3),
          stage_conv_b_width_per_group=1,
          stage_spatial_stride=(1, 2, 2, 2),
          stage_temporal_stride=(1, 2, 2, 2),
          bottleneck=create_bottleneck_block,
          # Head configs.
          head_pool=nn.AvgPool3d,
          head_pool_kernel_size=(
              cfg.DATA.NUM_FRAMES // 8,
              cfg.DATA.TRAIN_CROP_SIZE // 32,
              cfg.DATA.TRAIN_CROP_SIZE // 32,
          ),
          head_activation=None,
          head_output_with_global_average=False,
      )
  
      self.post_act = get_head_act(cfg.MODEL.HEAD_ACT)
  
imports: from functools import partial
  import torch.nn
  from detectron2.layers import ROIAlign
  from slowfast.models.batchnorm_helper import get_norm
  from slowfast.models.video_model_builder import _POOL1, _TEMPORAL_KERNEL_BASIS
  from pytorchvideo.models.csn import create_csn
  from pytorchvideo.models.head import create_res_basic_head, create_res_roi_pooling_head
  from pytorchvideo.models.r2plus1d import create_2plus1d_bottleneck_block, create_r2plus1d
  from pytorchvideo.models.resnet import create_bottleneck_block, create_resnet
  from pytorchvideo.models.slowfast import create_slowfast
  from pytorchvideo.models.vision_transformers import create_multiscale_vision_transformers
  from pytorchvideo.models.x3d import Swish, create_x3d, create_x3d_bottleneck_block
  from .build import MODEL_REGISTRY
label_desc: Use image node_id 2 for calling the PTVCSN obj's underlying member method code with example usage: obj._construct_network(cfg) without return types