提交 63f6f7c3 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1987 Add op names mapping for low level optimizer pass

Merge pull request !1987 from huanghui/add-op-mapping-attrs-for-low-level-opt-pass
......@@ -18,6 +18,7 @@
#include <memory>
#include <vector>
#include <tuple>
#include <string>
#include "session/anf_runtime_algorithm.h"
#include "common/utils.h"
......@@ -50,6 +51,8 @@ CNodePtr GenerateSquareSumV1(const FuncGraphPtr &graph, const CNodePtr &square,
square_sumv1->set_scope(sum->scope());
AnfAlgo::CopyNodeAttr(kAttrAxis, sum, square_sumv1);
AnfAlgo::CopyNodeAttr(kAttrKeepDims, sum, square_sumv1);
auto names = MakeValue<std::vector<std::string>>({prim::kPrimSquare->name(), prim::kPrimReduceSum->name()});
AnfAlgo::SetNodeAttr(kAttrDatadumpOriginalNames, names, square_sumv1);
return square_sumv1;
}
......@@ -71,6 +74,8 @@ CNodePtr GenerateSquareSumV2(const FuncGraphPtr &graph, const CNodePtr &square,
square_sumv2->set_scope(sum->scope());
AnfAlgo::CopyNodeAttr(kAttrAxis, sum, square_sumv2);
AnfAlgo::CopyNodeAttr(kAttrKeepDims, sum, square_sumv2);
auto names = MakeValue<std::vector<std::string>>({prim::kPrimSquare->name(), prim::kPrimReduceSum->name()});
AnfAlgo::SetNodeAttr(kAttrDatadumpOriginalNames, names, square_sumv2);
return square_sumv2;
}
......
......@@ -201,6 +201,7 @@ constexpr auto kAttrLabelIndex = "label_index";
constexpr auto kAttrLabelSwitchList = "label_switch_list";
constexpr auto kAttrNewAxisMask = "new_axis_mask";
constexpr auto kAttrShrinkAxisMask = "shrink_axis_mask";
constexpr auto kAttrDatadumpOriginalNames = "_datadump_original_names";
// attr value
constexpr auto kValueTargetSwitch = "target_switch";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册