diff --git a/mindspore/ccsrc/backend/common/pass/convert_tuple_output_to_maketuple.cc b/mindspore/ccsrc/backend/common/pass/convert_tuple_output_to_maketuple.cc index 77c367ce942..9b4bd9eeb1b 100644 --- a/mindspore/ccsrc/backend/common/pass/convert_tuple_output_to_maketuple.cc +++ b/mindspore/ccsrc/backend/common/pass/convert_tuple_output_to_maketuple.cc @@ -60,7 +60,8 @@ bool IsNeedConvert(const FuncGraphPtr &func_graph, const AnfNodePtr &input) { MS_EXCEPTION_IF_NULL(input); return (input->Type() != nullptr && AnfUtils::IsRealKernel(input) && common::AnfAlgo::IsTupleOutput(input) && !common::AnfAlgo::CheckPrimitiveType(input, prim::kPrimCall) && - (input->isa() || input->isa() || IsKerenlGraphOutput(func_graph, input))); + (input->isa() || input->isa() || IsKerenlGraphOutput(func_graph, input)) && + (!common::AnfAlgo::IsDynamicSequence(input))); } } // namespace @@ -88,11 +89,6 @@ const AnfNodePtr ConvertTupleOutputToMaketuple::Process(const FuncGraphPtr &func return nullptr; } - // Dynamic sequence does not need to be converted. - if (common::AnfAlgo::IsDynamicSequence(cnode)) { - return nullptr; - } - bool cnode_input_changed = false; for (size_t i = 0; i < cnode->inputs().size(); ++i) { const auto &input = cnode->inputs()[i];