code: def test_const_extraction():
      mod = tvm.tir.transform.ExtractPrimFuncConstants()(Module4)
      constants = mod.attrs["constants"]
      assert len(constants) == 2
  
      def _visit(stmt):
          if isinstance(stmt, tvm.tir.AllocateConst):
              assert np.array_equal(
                  stmt.data.numpy(),
                  constants[int(stmt.irmod_storage_idx)].numpy(),
              )
  
      for n, f in mod.functions.items():
          tvm.tir.stmt_functor.post_order_visit(f.body, _visit)
  
      tvm.lower(mod)
  
file_path: tvm/tests/python/tir-transform/test_tir_transform_extract_constants.py
imports: import numpy
  import tvm
  from tvm import tir
  from tvm.script import tir
  import tvm.testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_const_extraction() without return types