Browse Source

use the full_name as node_name

tags/0.7.0-beta
Li Hongzhang 5 years ago
parent
commit
c4325055aa
3 changed files with 46 additions and 19 deletions
  1. +7
    -2
      mindinsight/datavisual/data_transform/graph/msgraph.py
  2. +6
    -1
      mindinsight/datavisual/proto_files/mindinsight_anf_ir.proto
  3. +33
    -16
      mindinsight/datavisual/proto_files/mindinsight_anf_ir_pb2.py

+ 7
- 2
mindinsight/datavisual/data_transform/graph/msgraph.py View File

@@ -17,6 +17,7 @@ import time

from mindinsight.datavisual.common.log import logger
from mindinsight.datavisual.proto_files.mindinsight_anf_ir_pb2 import DataType
from mindinsight.datavisual.common.enums import PluginNameEnum
from .node import Node
from .node import NodeTypeEnum
from .graph import Graph
@@ -76,8 +77,12 @@ class MSGraph(Graph):
logger.warning("Finding a node with an empty name will not save it.")
continue

node_name = Node.create_node_name(scope=node_proto.scope,
base_name=f'{node_proto.op_type}{node_proto.name}')
if not node_proto.full_name or any(
node_proto.full_name.lower().endswith(f'[:{plugin.value.lower()}]') for plugin in PluginNameEnum):
node_name = Node.create_node_name(scope=node_proto.scope,
base_name=f'{node_proto.op_type}{node_proto.name}')
else:
node_name = node_proto.full_name
node = Node(name=node_name, node_id=node_proto.name)
node.type = node_proto.op_type
logger.debug("Foreach graph proto nodes, node id: %s, node name: %s, node def name: %s, "


+ 6
- 1
mindinsight/datavisual/proto_files/mindinsight_anf_ir.proto View File

@@ -85,9 +85,11 @@ enum DataType {
DT_BASE_FLOAT = 38; // type generate float
DT_TYPE = 39; // type type
DT_ANYTHING = 40; // type anything
DT_REFKEY = 41; // type refkey
DT_REF = 42; // type ref
}

// Value definiton for attribute value or parameter default value
// Value definition for attribute value or parameter default value
message ValueProto {
// data type of value
optional DataType dtype = 1; // discriminator that indicates which field below is in use
@@ -223,6 +225,9 @@ message NodeProto {

// other fields for debug
optional uint64 output_i = 7;

// The full_name_with_scope of CNode
optional string full_name = 8;
}

// Models


+ 33
- 16
mindinsight/datavisual/proto_files/mindinsight_anf_ir_pb2.py
File diff suppressed because it is too large
View File


Loading…
Cancel
Save