forked from mindspore-Ecosystem/mindspore
!2343 add scope info in binary format
Merge pull request !2343 from leopz/master
This commit is contained in:
commit
2d50a43be9
|
@ -365,7 +365,7 @@ void IrExportBuilder::SetShapeToNodeProto(const CNodePtr &node, onnx::NodeProto
|
||||||
// 1. prim ArgMaxWithValue need to get shape from tuple element
|
// 1. prim ArgMaxWithValue need to get shape from tuple element
|
||||||
// 2. some cnode doesn't has shape, such as LayerNorm
|
// 2. some cnode doesn't has shape, such as LayerNorm
|
||||||
// 3. other cnodes have shape
|
// 3. other cnodes have shape
|
||||||
if (node->IsApply(prim::kPrimArgMaxWithValue)) {
|
if (node->IsApply(prim::kPrimArgMaxWithValue) || node->IsApply(prim::kPrimLayerNorm)) {
|
||||||
auto type = node->Type();
|
auto type = node->Type();
|
||||||
auto shape = node->Shape();
|
auto shape = node->Shape();
|
||||||
if (!type->isa<Tuple>()) {
|
if (!type->isa<Tuple>()) {
|
||||||
|
@ -407,6 +407,7 @@ void IrExportBuilder::BuildCNode(const CNodePtr &node, onnx::GraphProto *const g
|
||||||
std::string output_name = GetUniqueNodeName(node);
|
std::string output_name = GetUniqueNodeName(node);
|
||||||
node_proto->add_output(output_name);
|
node_proto->add_output(output_name);
|
||||||
node_proto->set_name(output_name);
|
node_proto->set_name(output_name);
|
||||||
|
node_proto->set_domain(node->fullname_with_scope());
|
||||||
AnfNodePtr op = node->input(0);
|
AnfNodePtr op = node->input(0);
|
||||||
std::string type_name = GetOpTypeName(op);
|
std::string type_name = GetOpTypeName(op);
|
||||||
node_proto->set_op_type(type_name);
|
node_proto->set_op_type(type_name);
|
||||||
|
|
Loading…
Reference in New Issue