code: def test_binary_op():
      def check_binary_op(opfunc, ref):
          n = te.size_var("n")
          t1 = relay.TensorType((5, n, 5))
          t2 = relay.TensorType((n, 1))
          x = relay.var("x", t1)
          y = relay.var("y", t2)
          z = opfunc(x, y)
          # test printer
          assert ("{}(%x, %y)".format(z.op.name)) in z.astext()
          zz = run_infer_type(z)
          assert zz.checked_type == t1
  
          if ref is not None:
              t1 = relay.TensorType((5, 10, 5))
              t2 = relay.TensorType((5, 10, 5))
              x = relay.var("x", t1)
              y = relay.var("y", t2)
              z = opfunc(x, y)
              x_data = np.random.rand(5, 10, 5).astype(t1.dtype)
              y_data = np.random.rand(5, 10, 5).astype(t2.dtype)
              ref_res = ref(x_data, y_data)
              func = relay.Function([x, y], z)
  
              for target, dev in tvm.testing.enabled_targets():
                  op_res = relay.create_executor(
                      "graph", device=dev, target=target
                  ).evaluate(func)(x_data, y_data)
                  tvm.testing.assert_allclose(op_res.numpy(), ref_res)
  
      for opfunc, ref in [(relay.power, np.power)]:
          check_binary_op(opfunc, ref)
  
imports: import sys
  import numpy
  import numpy.random
  import pytest
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import relay, te
  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_binary_op() without return types