code: def test_reduce(
      self,
      target,
      dev,
      relay_func,
      ref_func,
      executor_kind,
      data,
      axis,
      keepdims,
      exclude,
      output,
  ):
      dtype = "bool" if ref_func in [np.all, np.any] else "float32"
      out_type = (
          "int32"
          if relay_func in [relay.argmin, relay.argmax]
          else dtype
      )
  
      target = tvm.target.Target(target)
      if target.kind.name == "vulkan" and dtype == "bool":
          pytest.xfail("Known failing test on vulkan runtime")
  
      x = relay.var("x", relay.TensorType(data, dtype))
      if relay_func == relay.logsumexp:
          z = relay_func(x, axis, keepdims)
      else:
          z = relay_func(x, axis, keepdims, exclude)
      zz = run_infer_type(z)
      if axis:
          assert "axis=" in z.astext()
      if keepdims:
          assert "keepdims=" in z.astext()
      if exclude:
          assert "exclude=" in z.astext()
      assert zz.checked_type == relay.ty.TensorType(output, out_type)
  
      if all(isinstance(v, tvm.tir.Var) == 1 for v in data):
          return
  
      func = relay.Function([x], z)
      x_data = (
          np.random.choice([True, False], size=data)
          if ref_func in [np.all]
          else np.random.uniform(size=data).astype(dtype)
      )
  
      if ref_func in [np.sum]:
          ref_res = ref_func(
              x_data + 0, axis=axis, dtype=dtype, keepdims=keepdims
          )
      elif ref_func in [np.max, np.min, np.mean, np.prod]:
          ref_res = ref_func(x_data + 0, axis=axis, keepdims=keepdims)
      else:  # argmin/argmax
          if axis and not isinstance(axis, int) and len(axis) > 1:
              return
          ref_res = ref_func(x_data + 0, axis=axis, keepdims=keepdims)
  
      op_res1 = relay.create_executor(
          executor_kind, device=dev, target=target
      ).evaluate(func)(x_data)
      tvm.testing.assert_allclose(op_res1.numpy(), ref_res, rtol=1e-5)
  
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 the TestReduceFunctions obj's underlying member method code with example usage: obj.test_reduce(target, dev, relay_func, ref_func, executor_kind, data, axis, keepdims, exclude, output) without return types