diff --git a/src/relax/transform/lift_transform_params.cc b/src/relax/transform/lift_transform_params.cc index 180c0be8910d..df7242efd462 100644 --- a/src/relax/transform/lift_transform_params.cc +++ b/src/relax/transform/lift_transform_params.cc @@ -703,7 +703,8 @@ std::vector> GetTargetFunctions( const IRModule& mod, const Variant>& shared_transform) { std::vector> target_functions; if (shared_transform.as>().value_or(Array{}).size()) { - for (const auto& name : shared_transform.as>().value()) { + auto names = shared_transform.as>().value(); + for (const auto& name : names) { auto gvar = mod->global_var_map_.Get(name); CHECK(gvar) << "When LiftTransformParams is called with a list of function names, " << "all function names must occur within the IRModule. "