code: def test_const_fold3():
      # Test that using ints with logic operations is forbidden
      x = te.var("x")
      for val in [0, 1]:
          for func in [tvm.tir.all, tvm.tir.any]:
              check_throws(lambda: func(tvm.tir.const(val, "uint1"), x))
              check_throws(lambda: func(x, tvm.tir.const(val, "uint1")))
  
      # Test const folding when both arguments are const
      for tvm_func, py_func in [
          (tvm.tir.all, lambda a, b: a and b),
          (tvm.tir.any, lambda a, b: a or b),
      ]:
          for v1 in [0, 1]:
              for v2 in [0, 1]:
                  assert tvm.ir.structural_equal(
                      tvm_func(
                          tvm.tir.const(v1, "uint1"),
                          tvm.tir.const(v2, "uint1"),
                      ),
                      tvm.tir.const(py_func(v1, v2), "uint1"),
                  )
  
      x = te.var("x", "uint1")
      true = tvm.tir.const(1, "uint1")
      false = tvm.tir.const(0, "uint1")
  
      assert tvm.tir.all(x, true).same_as(x)
      assert tvm.tir.all(true, x).same_as(x)
      assert tvm.tir.any(x, false).same_as(x)
      assert tvm.tir.any(false, x).same_as(x)
  
      assert tvm.tir.all(x, false).same_as(false)
      assert tvm.tir.all(false, x).same_as(false)
      assert tvm.tir.any(x, true).same_as(true)
      assert tvm.tir.any(true, x).same_as(true)
  
file_path: tvm/tests/python/tir-base/test_tir_ops.py
imports: import tvm
  import tvm.testing
  from tvm import te
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_const_fold3() without return types