docstr: Test simple ResNetRoIHead
  (without pool_spatial, roi, dropout and activation layers).
docstr_tok: ["Test","simple","ResNetRoIHead","(","without","pool_spatial",",","roi",",","dropout","and","activation","layers",")","."]
code: def test_build_simple_head(self):
      """
      Test simple ResNetRoIHead
      (without pool_spatial, roi, dropout and activation layers).
      """
      for input_dim, output_dim in itertools.product(
          (4, 8), (4, 8, 16)
      ):
          model = ResNetRoIHead(
              proj=nn.Linear(input_dim, output_dim),
              pool=nn.AdaptiveAvgPool3d(1),
              output_pool=nn.AdaptiveAvgPool3d(1),
          )
          bboxes = None
  
          # Test forwarding.
          for input_tensor in TestHeadHelper._get_inputs(
              input_dim=input_dim
          ):
              if input_tensor.shape[1] != input_dim:
                  with self.assertRaises(RuntimeError):
                      output_tensor = model(input_tensor, bboxes)
                  continue
              else:
                  output_tensor = model(input_tensor, bboxes)
  
              input_shape = input_tensor.shape
              output_shape = output_tensor.shape
              output_shape_gt = (input_shape[0], output_dim)
  
              self.assertEqual(
                  output_shape,
                  output_shape_gt,
                  "Output shape {} is different from expected shape {}".format(
                      output_shape, output_shape_gt
                  ),
              )
  
imports: import itertools
  import unittest
  import numpy
  import torch
  from pytorchvideo.models.head import create_res_basic_head, create_res_roi_pooling_head, create_vit_basic_head, ResNetBasicHead, ResNetRoIHead, SequencePool
  from torch import nn
  from torchvision.ops import RoIAlign
label_desc: Use image node_id 2 for calling the TestRoIHeadHelper obj's underlying member method code with example usage: obj.test_build_simple_head() without return types