Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support creating Bool constants in the pattern_utils #7507

Merged
merged 1 commit into from
Feb 24, 2021
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: 3 additions & 0 deletions src/relay/transforms/pattern_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ namespace relay {
} else if (type == DataType::UInt(8)) { \
typedef uint8_t DType; \
{ __VA_ARGS__ } \
} else if (type == DataType::Bool()) { \
typedef bool DType; \
{ __VA_ARGS__ } \
} else if ((*tvm::runtime::Registry::Get("runtime._datatype_get_type_registered"))( \
static_cast<uint8_t>(type.code()))) { \
typedef double DType; \
Expand Down
2 changes: 1 addition & 1 deletion tests/python/relay/test_pass_simplify_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def after_right(x, elem_op, value):
assert tvm.ir.structural_equal(zz, after)

for shape in [[10], [10, 10], [10, 10, 10]]:
for dtype in ["float32", "int32"]:
for dtype in ["float32", "int32", "bool"]:
for value in [0, 1, 2]:
validate(shape, value, dtype)

Expand Down