code: def assertGraphSize(self, graph, size):
      nodes = list(
          filter(
              lambda n: (
                  n.kind() != "prim::BailOut"
                  and n.kind() != "prim::BailoutTemplate"
                  and n.kind() != "prim::TypeCheck"
                  and n.kind() != "prim::RequiresGradCheck"
              ),
              graph.nodes(),
          )
      )
      self.assertEqual(len(list(nodes)), size)
  
imports: import os
  import sys
  import unittest
  from torch.testing._internal.common_utils import GRAPH_EXECUTOR, ProfilingMode, num_profiled_runs, enable_profiling_mode_for_profiling_tests
  from torch.testing._internal.common_jit import check_against_reference
  import torch
  from torch.testing._internal.jit_utils import JitTestCase, disable_autodiff_subgraph_inlining
  from torch.testing import FileCheck
  from typing import List, Tuple, Optional
label_desc: Use image node_id 2 for calling the TestAutodiffSubgraphSlicing obj's underlying member method code with example usage: obj.assertGraphSize(graph, size) without return types