code: def _build_resnet(
      self,
      input_channel,
      input_clip_length,
      input_crop_size,
      model_depth,
      norm,
      activation,
  ):
      _MODEL_STAGE_DEPTH = {
          50: (3, 4, 6, 3),
          101: (3, 4, 23, 3),
          152: (3, 8, 36, 3),
      }
      stem_dim_out = 8
      model_num_class = 10
      stages = []
      # create the Stem for ResNet
      stem = ResNetBasicStem(
          conv=nn.Conv3d(
              input_channel,
              stem_dim_out,
              kernel_size=[3, 7, 7],
              stride=[1, 2, 2],
              padding=[1, 3, 3],
              bias=False,
          ),
          norm=None if norm is None else norm(stem_dim_out),
          activation=None if activation is None else activation(),
          pool=nn.MaxPool3d(
              kernel_size=[1, 3, 3], stride=[1, 2, 2], padding=[0, 1, 1]
          ),
      )
      stages.append(stem)
  
      # get the number of Blocks for each Stage
      stage_depths = _MODEL_STAGE_DEPTH[model_depth]
  
      stage_dim_in = stem_dim_out
      stage_dim_out = stage_dim_in * 4
      stage_spatial_stride = (2, 1, 1, 1)
      stage_temporal_stride = (2, 1, 1, 1)
  
      # create each Stage for ResNet
      for i in range(len(stage_depths)):
          stage_dim_inner = stage_dim_out // 4
          depth = stage_depths[i]
  
          block_dim_in = stage_dim_in
          block_dim_inner = stage_dim_inner
          block_dim_out = stage_dim_out
  
          blocks = []
          for j in range(depth):
              spatial_stride = stage_spatial_stride[i] if j == 0 else 1
              temporal_stride = (
                  stage_temporal_stride[i] if j == 0 else 1
              )
              # create each Block for the Stage
              block = ResBlock(
                  branch1_conv=nn.Conv3d(
                      block_dim_in,
                      block_dim_out,
                      kernel_size=(1, 1, 1),
                      stride=(
                          temporal_stride,
                          spatial_stride,
                          spatial_stride,
                      ),
                      bias=False,
                  )
                  if block_dim_in != block_dim_out
                  else None,
                  branch1_norm=None
                  if norm is None
                  else norm(block_dim_out)
                  if block_dim_in != block_dim_out
                  else None,
                  branch2=BottleneckBlock(
                      conv_a=nn.Conv3d(
                          block_dim_in,
                          block_dim_inner,
                          kernel_size=[3, 1, 1],
                          stride=[temporal_stride, 1, 1],
                          padding=[1, 0, 0],
                          bias=False,
                      ),
                      norm_a=None
                      if norm is None
                      else norm(block_dim_inner),
                      act_a=None
                      if activation is None
                      else activation(),
                      conv_b=nn.Conv3d(
                          block_dim_inner,
                          block_dim_inner,
                          kernel_size=[1, 3, 3],
                          stride=[1, spatial_stride, spatial_stride],
                          padding=[0, 1, 1],
                          bias=False,
                      ),
                      norm_b=None
                      if norm is None
                      else norm(block_dim_inner),
                      act_b=None
                      if activation is None
                      else activation(),
                      conv_c=nn.Conv3d(
                          block_dim_inner,
                          block_dim_out,
                          kernel_size=[1, 1, 1],
                          stride=[1, 1, 1],
                          padding=[0, 0, 0],
                          bias=False,
                      ),
                      norm_c=None
                      if norm is None
                      else norm(block_dim_out),
                  ),
                  activation=None
                  if activation is None
                  else activation(),
                  branch_fusion=lambda x, y: x + y,
              )
  
              block_dim_in = block_dim_out
              blocks.append(block)
  
          stage = ResStage(nn.ModuleList(blocks))
          stages.append(stage)
  
          stage_dim_in = stage_dim_out
          stage_dim_out = stage_dim_out * 2
  
      # Create Head for ResNet
      total_spatial_stride = 4 * np.prod(stage_spatial_stride)
      total_temporal_stride = np.prod(stage_temporal_stride)
      head_pool_kernel_size = (
          input_clip_length // total_temporal_stride,
          input_crop_size // total_spatial_stride,
          input_crop_size // total_spatial_stride,
      )
  
      head = ResNetBasicHead(
          proj=nn.Linear(stage_dim_in, model_num_class),
          activation=nn.Softmax(),
          pool=nn.AvgPool3d(
              kernel_size=head_pool_kernel_size, stride=[1, 1, 1]
          ),
          dropout=None,
          output_pool=nn.AdaptiveAvgPool3d(1),
      )
      stages.append(head)
  
      return (Net(blocks=nn.ModuleList(stages)), model_num_class)
  
imports: import itertools
  import os
  import unittest
  import numpy
  import torch
  from pytorchvideo.models.head import ResNetBasicHead
  from pytorchvideo.models.net import Net
  from pytorchvideo.models.resnet import BottleneckBlock, create_acoustic_bottleneck_block, create_acoustic_resnet, create_bottleneck_block, create_res_block, create_res_stage, create_resnet, create_resnet_with_roi_head, ResBlock, ResStage, SeparableBottleneckBlock
  from pytorchvideo.models.stem import ResNetBasicStem
  from torch import nn
label_desc: Use image node_id 2 for calling the TestResNet obj's underlying member method code with example usage: obj._build_resnet(input_channel, input_clip_length, input_crop_size, model_depth, norm, activation) and returns: Net,  model_num_class