From 9874ffa3ea106de6121d641263a4bcdcf2d9e42d Mon Sep 17 00:00:00 2001 From: Zhang Qinghua Date: Fri, 11 Dec 2020 15:37:56 +0800 Subject: [PATCH] Dump FV nodes in *.ir file. ex.) $(fg_xxx.xx:[CNode]xx) --- mindspore/ccsrc/debug/anf_ir_dump.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/debug/anf_ir_dump.cc b/mindspore/ccsrc/debug/anf_ir_dump.cc index bd38fb3e31..09ce5640d6 100644 --- a/mindspore/ccsrc/debug/anf_ir_dump.cc +++ b/mindspore/ccsrc/debug/anf_ir_dump.cc @@ -217,6 +217,10 @@ void DumpOperator(const AnfNodePtr &op, const std::shared_ptr &g } else if (op->isa()) { if (gsub->local_var_map.find(op) != gsub->local_var_map.end()) { gsub->buffer << "%" << gsub->local_var_map[op]; + } else { + auto node = op->cast(); + auto fg = node->func_graph(); + gsub->buffer << "$(" << fg->ToString() << "." << fg->debug_info()->get_id() << ":" << node->ToString() << ")"; } } else if (op->isa()) { gsub->buffer << GetValueNode(op)->ToString(); @@ -249,7 +253,13 @@ void DumpOperands(const AnfNodePtr &nd, OrderedMap *para_ma gsub->buffer << "%para" << (*para_map)[in]; } } else if (in->isa()) { - gsub->buffer << "%" << gsub->local_var_map[in]; + if (gsub->local_var_map.find(in) != gsub->local_var_map.end()) { + gsub->buffer << "%" << gsub->local_var_map[in]; + } else { + auto node = in->cast(); + auto fg = node->func_graph(); + gsub->buffer << "$(" << fg->ToString() << "." << fg->debug_info()->get_id() << ":" << node->ToString() << ")"; + } } else if (in->isa() && !IsValueNode(in)) { // non Primitive valuenode gsub->buffer << GetValueNode(in)->ToString();