code: def test_reverse_ad_identity():
      """Simple test with reverse mode ad."""
      # of f(x) = x
      mod = tvm.IRModule()
  
      shape = (10, 10)
      dtype = "float32"
      t = relay.TensorType(shape, dtype)
  
      x = relay.var("x", t)
  
      func = relay.Function([x], x)
      func = run_infer_type(func)
      back_func = transform.gradient(func)
      back_func = run_infer_type(back_func)
  
      mod["main"] = back_func
      mod = transform.InferType()(mod)
      mod = transform.LazyGradientInit()(mod)
      back_func = mod["main"]
  
      assert mod["main"].checked_type == relay.FuncType(
          [t], relay.TupleType([t, relay.TupleType([t])])
      )
  
      x = rand(dtype, *shape)
      (forward), (grad,) = create_executor(mod=mod).evaluate(back_func)(
          x
      )
      assert_allclose(forward.numpy(), x.numpy())
      assert_allclose(grad.numpy(), np.ones_like(x.numpy()))
  
imports: import numpy
  import tvm
  from tvm import relay
  from tvm.relay import create_executor, transform
  from tvm.relay.testing import rand, run_infer_type
  import tvm.testing
  from tvm.testing import assert_allclose
label_desc: Use image node_id 7 for calling a global function with example usage: test_reverse_ad_identity() without return types