docstr: Test builder `create_resnet` with callable inputs.
code: def test_create_resnet_with_callable(self):
      """
      Test builder `create_resnet` with callable inputs.
      """
      for norm, activation in itertools.product(
          (nn.BatchNorm3d, None), (nn.ReLU, nn.Sigmoid, None)
      ):
          input_channel = 3
          input_clip_length = 4
          input_crop_size = 56
          model_depth = 50
          stage_spatial_stride = (2, 1, 1, 1)
          stage_temporal_stride = (2, 1, 1, 1)
          model_gt, num_class = self._build_resnet(
              input_channel,
              input_clip_length,
              input_crop_size,
              model_depth,
              norm,
              activation,
          )
  
          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,
          )
  
          model = create_resnet(
              input_channel=input_channel,
              model_depth=50,
              model_num_class=num_class,
              dropout_rate=0,
              norm=norm,
              activation=activation,
              stem_dim_out=8,
              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_conv_a_kernel_size=((3, 1, 1),) * 4,
              stage_conv_b_kernel_size=((1, 3, 3),) * 4,
              stage_spatial_h_stride=stage_spatial_stride,
              stage_spatial_w_stride=stage_spatial_stride,
              stage_temporal_stride=stage_temporal_stride,
              bottleneck=create_bottleneck_block,
              head_pool=nn.AvgPool3d,
              head_pool_kernel_size=head_pool_kernel_size,
              head_output_size=(1, 1, 1),
              head_activation=nn.Softmax,
          )
  
          model.load_state_dict(
              model_gt.state_dict(), strict=True
          )  # explicitly use strict mode.
  
          # Test forwarding.
          for tensor in TestResNet._get_inputs(
              input_channel, input_clip_length, input_crop_size
          ):
              with torch.no_grad():
                  if tensor.shape[1] != input_channel:
                      with self.assertRaises(RuntimeError):
                          out = model(tensor)
                      continue
  
                  out = model(tensor)
                  out_gt = model_gt(tensor)
  
              self.assertEqual(
                  out.shape,
                  out_gt.shape,
                  "Output shape {} is different from expected shape {}".format(
                      out.shape, out_gt.shape
                  ),
              )
              self.assertTrue(
                  np.allclose(
                      out.numpy(), out_gt.numpy(), rtol=1e-1, atol=1e-1
                  )
              )
  
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 4 for calling the TestResNet obj's underlying member method code with example usage: obj.test_create_resnet_with_callable() without return types