code: def checkShapeAnalysis(
      self,
      out_sizes: Union[List[int], List[List[int]]],
      traced_graph,
      assert_propagation,
      constant_prop=True,
  ):
      # repropagte input shapes provided by tracing,
      prev_symbolic_shapes_test_enabled = (
          torch._C._jit_symbolic_shapes_test_mode_enabled()
      )
      for enable_test_mode in [True, False]:
          # here we are testing allowing/disallowing substituting in complete shapes as constants,
          # disallowing constants helps stress test partial eval and substitution pipeline
          torch._C._jit_set_symbolic_shapes_test_mode(enable_test_mode)
          torch._C._jit_erase_non_input_shape_information(traced_graph)
          if constant_prop:
              torch._C._jit_pass_constant_propagation(traced_graph)
          torch._C._jit_pass_propagate_shapes_on_graph(traced_graph)
          # Add sizes to default tensor type to avoid checking something out of scope
          # and difficulties with tracer leaving in other parts of tensor type
          output = next(traced_graph.outputs()).type()
  
          def test_type(type, actual_size):
              sizes = type.symbolic_sizes()
              out_type = TensorType.get().with_sizes(sizes)
              actual_type = TensorType.get().with_sizes(actual_size)
  
              # always check actual shape is a subtype of the output
              self.assertTrue(actual_type.isSubtypeOf(out_type))
  
              # and then if assertion flag is provided, check shape analysis
              # is successful
              if assert_propagation:
                  self.assertEqual(out_type.sizes(), actual_size)
  
          if output.isSubtypeOf(torch._C.TensorType.get()):
              test_type(output, out_sizes)
          else:
              tuple_elements = output.elements()
              for i in range(len(tuple_elements)):
                  test_type(tuple_elements[i], out_sizes[i])
  
      torch._C._jit_set_symbolic_shapes_test_mode(
          prev_symbolic_shapes_test_enabled
      )
  
imports: import torch
  import torch.cuda
  import torch.jit
  import torch.jit._logging
  import torch.jit.frontend
  import torch.jit.quantized
  from torch.testing._internal.common_dtype import floating_and_complex_types_and
  from torch.testing._internal.common_utils import TestCase, freeze_rng_state, TemporaryFileName, enable_profiling_mode_for_profiling_tests, is_iterable_of_tensors
  from torch.testing._internal.common_utils import enable_profiling_mode
  from itertools import chain
  from typing import List, Union
  from torch._C import TensorType
  import io
label_desc: Use image node_id 8 for calling the JitCommonTestCase obj's underlying member method code with example usage: obj.checkShapeAnalysis(out_sizes, traced_graph, assert_propagation, constant_prop) without return types