code: def test_sum_with_bool_input():
      def verify(dshape, axis, keepdims, exclude):
          x = relay.var("x", relay.TensorType(dshape, "bool"))
  
          y = relay.sum(x, axis, keepdims, exclude)
  
          func = relay.Function([x], y)
          func = run_infer_type(func)
  
          text = func.astext()
          assert "sum" in text
  
          data = np.random.choice([False, True], size=dshape)
  
          if exclude and axis is not None:
              axis = tuple(set(range(len(dshape))) - set(axis))
  
          ref_res = np.sum(data, axis, keepdims=keepdims, dtype="bool")
          for target, dev in tvm.testing.enabled_targets():
              op_res = relay.create_executor(
                  "graph", device=dev, target=target
              ).evaluate(func)(data)
              tvm.testing.assert_allclose(op_res.numpy(), ref_res)
  
      verify((3, 5, 7, 9), None, False, False)
      verify((3, 5, 7, 9), None, True, False)
      verify((3, 5, 7, 9), (0,), False, False)
      verify((3, 5, 7, 9), (1,), True, False)
      verify((3, 5, 7, 9), (2, 3), False, True)
      verify((3, 5, 7, 9), (0, 2), True, True)
      verify((3, 5, 7, 9), (0, 1, 2, 3), False, False)
      verify((3, 5, 7, 9), (0, 1, 2, 3), False, True)
      verify((3, 5, 7, 9), (0, 1, 2, 3), True, False)
      verify((3, 5, 7, 9), (0, 1, 2, 3), True, True)
  
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 10 for calling a global function with example usage: test_sum_with_bool_input() without return types