Skip to content

Commit

Permalink
Delegate to IntImm converter for Integer
Browse files Browse the repository at this point in the history
This way, both converters handle the cases where the value to be
converted is out of bounds for a 32-bit integer.
  • Loading branch information
Lunderberg committed Feb 8, 2024
1 parent e0f7408 commit 440568e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/tvm/ir/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,7 @@ template <>
struct PackedFuncValueConverter<tvm::Integer> {
template <typename PODSubclass>
static tvm::Integer From(const PODSubclass& val) {
if (auto opt = val.TryAsInt()) {
return Integer(opt.value());
} else if (auto opt = val.TryAsBool()) {
if (auto opt = PackedFuncValueConverter<tvm::IntImm>::TryFrom(val)) {
return Integer(opt.value());
} else {
return val.template AsObjectRef<tvm::Integer>();
Expand Down

0 comments on commit 440568e

Please sign in to comment.