From b64b8163115be2b74eaf6f7598668ee34f075cd8 Mon Sep 17 00:00:00 2001 From: csy0225 <78470701+csy0225@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:24:45 +0800 Subject: [PATCH] fix_delete_repeated_ops_pass bug (#53042) --- paddle/fluid/framework/ir/delete_repeated_ops_pass.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paddle/fluid/framework/ir/delete_repeated_ops_pass.cc b/paddle/fluid/framework/ir/delete_repeated_ops_pass.cc index cf5bb15c207..2f85d5b2880 100644 --- a/paddle/fluid/framework/ir/delete_repeated_ops_pass.cc +++ b/paddle/fluid/framework/ir/delete_repeated_ops_pass.cc @@ -151,6 +151,8 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) { auto starts = slice_op_desc->GetAttrIfExists>("starts"); auto ends = slice_op_desc->GetAttrIfExists>("ends"); auto axes = slice_op_desc->GetAttrIfExists>("axes"); + auto decrease_axis = + slice_op_desc->GetAttrIfExists>("decrease_axis"); attr_key += "starts_"; for (auto start : starts) { attr_key += std::to_string(start) + "_"; @@ -163,6 +165,10 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) { for (auto axis : axes) { attr_key += std::to_string(axis) + "_"; } + attr_key += "decrease_axis_"; + for (auto axis : decrease_axis) { + attr_key += std::to_string(axis) + "_"; + } return attr_key; } -- GitLab