未验证 提交 b64b8163 编写于 作者: C csy0225 提交者: GitHub

fix_delete_repeated_ops_pass bug (#53042)

上级 38ec37cd
...@@ -151,6 +151,8 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) { ...@@ -151,6 +151,8 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) {
auto starts = slice_op_desc->GetAttrIfExists<std::vector<int>>("starts"); auto starts = slice_op_desc->GetAttrIfExists<std::vector<int>>("starts");
auto ends = slice_op_desc->GetAttrIfExists<std::vector<int>>("ends"); auto ends = slice_op_desc->GetAttrIfExists<std::vector<int>>("ends");
auto axes = slice_op_desc->GetAttrIfExists<std::vector<int>>("axes"); auto axes = slice_op_desc->GetAttrIfExists<std::vector<int>>("axes");
auto decrease_axis =
slice_op_desc->GetAttrIfExists<std::vector<int>>("decrease_axis");
attr_key += "starts_"; attr_key += "starts_";
for (auto start : starts) { for (auto start : starts) {
attr_key += std::to_string(start) + "_"; attr_key += std::to_string(start) + "_";
...@@ -163,6 +165,10 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) { ...@@ -163,6 +165,10 @@ std::string GenSliceAttrKey(OpDesc* slice_op_desc) {
for (auto axis : axes) { for (auto axis : axes) {
attr_key += std::to_string(axis) + "_"; attr_key += std::to_string(axis) + "_";
} }
attr_key += "decrease_axis_";
for (auto axis : decrease_axis) {
attr_key += std::to_string(axis) + "_";
}
return attr_key; return attr_key;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册