From 8caa214854280fb69b478c548615cb7b7f56630e Mon Sep 17 00:00:00 2001 From: xlchen <792512955@qq.com> Date: Tue, 29 Jul 2025 17:07:41 +0800 Subject: [PATCH] [Fix] Fix the wrong check for tuple node in #18163 --- src/relax/transform/fuse_ops.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/relax/transform/fuse_ops.cc b/src/relax/transform/fuse_ops.cc index 434a7e7653a5..a222f44a0983 100644 --- a/src/relax/transform/fuse_ops.cc +++ b/src/relax/transform/fuse_ops.cc @@ -427,9 +427,7 @@ class FunctionCreator : public ExprMutator { } for (const Expr& arg : call->args) { - if (GetStructInfoAs(arg) != nullptr) { - // The argument is fully referenced. Thus we remove it from the mapping. - partially_used_tuple_params_.erase(arg.get()); + if (arg.as()) { const Tuple& tup_args = Downcast(arg); for (const Expr& tup_arg : tup_args->fields) { CheckDefAndUpdateParam(tup_arg); @@ -438,6 +436,10 @@ class FunctionCreator : public ExprMutator { } else { CheckDefAndUpdateParam(arg); } + if (GetStructInfoAs(arg) != nullptr) { + // The argument is fully referenced. Thus we remove it from the mapping. + partially_used_tuple_params_.erase(arg.get()); + } } } } else if (var_binding->value.as()) {