diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h index 2494809119668..e294353226b74 100644 --- a/include/tvm/ir/expr.h +++ b/include/tvm/ir/expr.h @@ -811,9 +811,7 @@ template <> struct PackedFuncValueConverter { template 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::TryFrom(val)) { return Integer(opt.value()); } else { return val.template AsObjectRef();