code: def test_checkpoint(executor_kind):
      dtype = "float32"
      xs = [relay.var("x{}".format(i), dtype) for i in range(4)]
      f = relay.multiply(
          relay.add(xs[0], xs[1]), relay.add(xs[2], xs[3])
      )
      f_checkpoint = relay.annotation.checkpoint(f)
  
      func, func_checkpoint = relay.Function(xs, f), relay.Function(
          xs, f_checkpoint
      )
      f, f_checkpoint = run_infer_type(func), run_infer_type(
          func_checkpoint
      )
      assert f.checked_type == f_checkpoint.checked_type
  
      inputs = [np.random.uniform() for _ in range(len(xs))]
      for target, dev in tvm.testing.enabled_targets():
          f_res = relay.create_executor(
              executor_kind, device=dev, target=target
          ).evaluate(f)(*inputs)
          f_checkpoint_res = relay.create_executor(
              executor_kind, device=dev, target=target
          ).evaluate(f_checkpoint)(*inputs)
          tvm.testing.assert_allclose(
              f_res.numpy(), f_checkpoint_res.numpy(), 0, 0
          )
  
imports: import sys
  import pytest
  import numpy
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import relay, te, topi
  from tvm.relay import transform
  from tvm.relay.testing import run_infer_type
label_desc: Use image node_id 1 for calling a global function with example usage: test_checkpoint(executor_kind) without return types