Browse Source

Set abstract value for reserved Depend node when merge Depend nodes.

tags/v1.2.0-rc1
Zhang Qinghua 4 years ago
parent
commit
f73f2d73f3
3 changed files with 7 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/debug/debugger/proto_exporter.cc
  2. +4
    -0
      mindspore/ccsrc/frontend/optimizer/irpass/updatestate_eliminate.cc
  3. +2
    -0
      mindspore/ccsrc/transform/express_ir/mindir_exporter.cc

+ 1
- 1
mindspore/ccsrc/debug/debugger/proto_exporter.cc View File

@@ -579,7 +579,7 @@ void DumpIRProtoWithSrcInfo(const FuncGraphPtr &func_graph, const std::string &s
ChangeFileMode(file_path, S_IRUSR);
}
#else
void DumpIRProtoWithSrcInfo(const FuncGraphPtr &, const std::string &, const std::string &) {
void DumpIRProtoWithSrcInfo(const FuncGraphPtr &, const std::string &, const std::string &, LocDebugDumpMode) {
static bool already_printed = false;
if (already_printed) {
return;


+ 4
- 0
mindspore/ccsrc/frontend/optimizer/irpass/updatestate_eliminate.cc View File

@@ -327,6 +327,10 @@ void EliminateUselessNodesForUpdateStates(const std::vector<CNodePtr> &update_st
// If all users are Depend CNode.
if (depend_nodes.size() == us_users.size()) {
end = 1;
// Set abstract value for reserved Depend node.
auto &reserved_depend_node = depend_nodes[0];
auto &primary_node = reserved_depend_node->cast<CNodePtr>()->input(kInputIndex);
reserved_depend_node->set_abstract(primary_node->abstract());
}
for (ssize_t i = depend_nodes.size() - 1; i >= end; i--) {
const auto &depend_node = depend_nodes[i];


+ 2
- 0
mindspore/ccsrc/transform/express_ir/mindir_exporter.cc View File

@@ -382,7 +382,9 @@ void IrExportBuilder::SetShapeToNodeProto(const CNodePtr &node, mind_ir::NodePro
// 3. save tuple string in ref_attr_name
MS_EXCEPTION_IF_NULL(node);
auto type = node->Type();
MS_EXCEPTION_IF_NULL(type);
auto shape = node->Shape();
MS_EXCEPTION_IF_NULL(shape);
ResetTupleIndex();
std::string seq_string = "shape:";
mind_ir::AttributeProto *attr_proto = node_proto->add_attribute();


Loading…
Cancel
Save