code: def test_nn_module_tests(self):
      with enable_profiling_mode():
          stats = [("Name", "Ifs/Loops", "non-tensor ops")]
          for test in get_all_nn_module_tests():
              out = try_get_nn_module_compiled_mod_and_inputs(**test)
              if not out:
                  continue
  
              mod, inputs = out
              test_name = get_nn_mod_test_name(**test)
              for _ in range(6):
                  mod(*inputs)
  
              g = torch.jit.last_executed_optimized_graph()
              stats.append(
                  (test_name, num_ifs_loops(g), num_non_tensor_nodes(g))
              )
  
          for line in stats:
              print(line)
  
file_path: pytorch/test/jit/test_complexity.py
imports: import contextlib
  import os
  import sys
  import unittest
  import torch
  from torch.testing._internal.jit_utils import JitTestCase, enable_profiling_mode
  from torch.testing._internal.jit_metaprogramming_utils import try_get_nn_module_compiled_mod_and_inputs, get_nn_mod_test_name, get_all_nn_module_tests, nn_functional_tests, get_nn_functional_compiled_fn_and_inputs
  from torch.testing._internal.common_utils import run_tests, set_default_dtype, suppress_warnings, IS_FBCODE
label_desc: Use image node_id 4 for calling the TestComplexity obj's underlying member method code with example usage: obj.test_nn_module_tests() without return types