code: def test_simple_graph():
      # A module with two subgraphs
      mod = tvm.IRModule()
  
      x0 = relay.var("x0", shape=(8, 8))
      y0 = relay.var("y0", shape=(8, 8))
      z0 = x0 + y0
      z1 = x0 - y0
      z2 = relay.Tuple((z0, z1))
      f0 = relay.Function([x0, y0], z2)
      f0 = f0.with_attr("Compiler", "test_graph")
      g0 = relay.GlobalVar("g0")
      mod[g0] = f0
      mod = relay.transform.InferType()(mod)
  
      x1 = relay.var("x1", shape=(8, 8))
      y1 = relay.var("y1", shape=(8, 8))
      z1 = x1 - y1
      f1 = relay.Function([x1, y1], z1)
      f1 = f1.with_attr("Compiler", "test_graph")
      g1 = relay.GlobalVar("g1")
      mod[g1] = f1
      mod = relay.transform.InferType()(mod)
  
      x = relay.var("x", shape=(8, 8))
      y = relay.var("y", shape=(8, 8))
      z = relay.var("z", shape=(8, 8))
      c0 = relay.Call(g0, [x, y])
      c1 = relay.Call(g1, [relay.TupleGetItem(c0, 0), z])
      fm = relay.Function([x, y, z], c1)
      mod["main"] = fm
      mod = relay.transform.InferType()(mod)
  
      x_data = np.random.rand(8, 8).astype("float32")
      y_data = np.random.rand(8, 8).astype("float32")
      z_data = np.random.rand(8, 8).astype("float32")
      data = get_calibration_data(
          mod, {"x": x_data, "y": y_data, "z": z_data}
      )
  
      # Check the number and orders
      check_data_size(mod, data)
      tvm.testing.assert_allclose(data[g0]["inputs"][0].numpy(), x_data)
      tvm.testing.assert_allclose(data[g0]["inputs"][1].numpy(), y_data)
      tvm.testing.assert_allclose(
          data[g0]["outputs"][0].numpy(), x_data + y_data
      )
      tvm.testing.assert_allclose(
          data[g0]["outputs"][1].numpy(), x_data - y_data
      )
      tvm.testing.assert_allclose(
          data[g1]["inputs"][0].numpy(), x_data + y_data
      )
      tvm.testing.assert_allclose(data[g1]["inputs"][1].numpy(), z_data)
      tvm.testing.assert_allclose(
          data[g1]["outputs"][0].numpy(), x_data + y_data - z_data
      )
  
file_path: tvm/tests/python/relay/test_analysis_get_calibration_data.py
imports: import numpy
  import tvm
  import tvm.relay.testing
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.analysis import get_calibration_data
label_desc: Use image node_id 2 for calling a global function with example usage: test_simple_graph() without return types