Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/script/printer/tir/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ TVM_STATIC_IR_FUNCTOR(IRDocsifier, vtable)
if (dtype == d->cfg->int_dtype) {
return LiteralDoc::Int(imm->value, imm_p->Attr("value"));
} else if (dtype == DataType::Bool()) {
return LiteralDoc::Boolean(imm->value, imm_p->Attr("value"));
return TIR(d, DType2Str(dtype))
->Call({LiteralDoc::Boolean(imm->value, imm_p->Attr("value"))});
} else {
return TIR(d, DType2Str(dtype))->Call({LiteralDoc::Int(imm->value, imm_p->Attr("value"))});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/python/unittest/test_tir_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def test_isnan():
y = te.var("y", "float16")
assert str(tvm.tir.isnan(y)) == 'T.isnan(T.Cast("float32", y))'
z = te.var("z", "int32")
assert str(tvm.tir.isnan(z)) == "False"
assert str(tvm.tir.isnan(z)) == "T.bool(False)"
k = te.var("k", "int8x2")
assert str(tvm.tir.isnan(k).dtype) == "uint1x2"

Expand Down
2 changes: 1 addition & 1 deletion tests/python/unittest/test_tir_schedule_compute_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def test_reverse_compute_inline_producer_predicate_disallowed():
sch.reverse_compute_inline(sch.get_block("compute_4"))

assert (
"that cannot be implied by the synthesized predicate True of the new inlined block"
"that cannot be implied by the synthesized predicate T.bool(True) of the new inlined block"
in str(e)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/python/unittest/test_tvmscript_printer_tir.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def test_select():
obj = tir.Select(True, 0, 2)
_assert_print(
obj,
"""T.Select(True, 0, 2)
"""T.Select(T.bool(True), 0, 2)
""",
)

Expand Down
2 changes: 2 additions & 0 deletions tests/python/unittest/test_tvmscript_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3444,7 +3444,9 @@ def func() -> None:
def bool_cast():
@T.prim_func
def func() -> None:
a = T.bool()
T.evaluate(T.bool(T.int32(0)))
T.evaluate(a == T.bool(False))

return func

Expand Down