From ad779f4e5736bf2e4b86ae1d901f35632232bddc Mon Sep 17 00:00:00 2001 From: ougongchang Date: Fri, 21 Aug 2020 10:09:39 +0800 Subject: [PATCH] set the parameter output data type --- .../datavisual/data_transform/graph/graph.py | 10 ++++++++ .../data_transform/graph/msgraph.py | 25 ++----------------- .../test_query_nodes_success_result3.json | 2 +- ...t_get_nodes_success_expected_results2.json | 2 +- ...t_get_nodes_success_expected_results3.json | 2 +- ...t_get_nodes_success_expected_results4.json | 2 +- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/mindinsight/datavisual/data_transform/graph/graph.py b/mindinsight/datavisual/data_transform/graph/graph.py index 69e3ca6..6baf86a 100644 --- a/mindinsight/datavisual/data_transform/graph/graph.py +++ b/mindinsight/datavisual/data_transform/graph/graph.py @@ -15,6 +15,8 @@ """ This file is used to define the basic graph. """ +import time + from enum import Enum from collections import defaultdict @@ -52,6 +54,8 @@ class Graph: def build_graph(self, proto_data): """This method is used to build the graph.""" + logger.info("Start to build graph") + start_time = time.time() # Notice: # The following methods are interdependent and cannot be switched at will. @@ -65,6 +69,12 @@ class Graph: self._add_variable_nodes(NodeTypeEnum.CONST.value) self._calc_subnode_count() + precision = 6 + time_consuming = round(time.time() - start_time, precision) + logger.info("Build graph end, all node count: %s, const count: %s, parameter count: %s, time-consuming: %s s.", + self.normal_node_count, len(self._const_node_temp_cache), + len(self._parameter_node_temp_cache), time_consuming) + def exist_node(self, name): """ Check node exist in graph. diff --git a/mindinsight/datavisual/data_transform/graph/msgraph.py b/mindinsight/datavisual/data_transform/graph/msgraph.py index 0d80f8b..2d2003b 100644 --- a/mindinsight/datavisual/data_transform/graph/msgraph.py +++ b/mindinsight/datavisual/data_transform/graph/msgraph.py @@ -13,8 +13,6 @@ # limitations under the License. # ============================================================================ """This file is used to define the MindSpore graph.""" -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 @@ -27,24 +25,6 @@ from .graph import EdgeTypeEnum class MSGraph(Graph): """The object describes the MindSpore graph, and it is defined in the anf_ir proto file.""" - def build_graph(self, proto_data): - """ - Build graph by graph proto which refer to `anf_ir_pb2.GraphProto`. - - Args: - proto_data (anf_ir_pb2.GraphProto): Refer to `anf_ir_pb2.GraphProto`. - """ - logger.info("Start to build graph, graph name: %s.", proto_data.name) - start_time = time.time() - - super(MSGraph, self).build_graph(proto_data) - - precision = 6 - time_consuming = round(time.time()-start_time, precision) - logger.info("Build graph end, all node count: %s, const count: %s, parameter count: %s, time-consuming: %s s.", - self.normal_node_count, len(self._const_node_temp_cache), - len(self._parameter_node_temp_cache), time_consuming) - def _parse_data(self, proto_data): """ The proto data is parsed and all nodes are stored in the specified structure. @@ -85,8 +65,6 @@ class MSGraph(Graph): 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, " - "input count: %s", node.node_id, node.name, node_proto.name, len(node_proto.input)) self._parse_attributes(node_proto.attribute, node) self._parse_inputs(node_proto.input, node) @@ -112,6 +90,7 @@ class MSGraph(Graph): continue node = Node(name=parameter.name, node_id=parameter.name) node.type = NodeTypeEnum.PARAMETER.value + node.output_data_type = self._get_data_type_by_parse_type_proto(parameter.type) node.output_shape = self._get_shape_by_parse_type_proto(parameter.type) attr = dict( type=self._get_data_type_by_parse_type_proto(parameter.type), @@ -237,7 +216,7 @@ class MSGraph(Graph): if attr.value.ByteSize() > self.MAX_NODE_ATTRIBUTE_VALUE_BYTES: message = f"The attribute value of node({node.name}) " \ f"is over {self.MAX_NODE_ATTRIBUTE_VALUE_BYTES} Bytes, will ignore." - logger.info(message) + logger.warning(message) continue node.add_attr({attr.name: str(attr.value)}) diff --git a/tests/st/func/datavisual/graph/graph_results/test_query_nodes_success_result3.json b/tests/st/func/datavisual/graph/graph_results/test_query_nodes_success_result3.json index d76f713..cd8a2d9 100644 --- a/tests/st/func/datavisual/graph/graph_results/test_query_nodes_success_result3.json +++ b/tests/st/func/datavisual/graph/graph_results/test_query_nodes_success_result3.json @@ -1 +1 @@ -{"nodes":[{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add50":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape1","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add51":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape2","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add52":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape3","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add53":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape4","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add54":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape5","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/conv1-Conv2d/Conv2D55":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,64,112,112]}},"name":"Default/bn1/Reshape[12]_1/Reshape6","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape7","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape8","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape9","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape10","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape11","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape12","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"}]} \ No newline at end of file +{"nodes":[{"name":"Default/bn1/Reshape[12]_1/Reshape1","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add50":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape2","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add51":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape3","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add52":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape4","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add53":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape5","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add54":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape6","type":"Reshape","attr":{},"input":{"Default/conv1-Conv2d/Conv2D55":{"shape":[1,64,112,112],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape7","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape8","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape9","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape10","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape11","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape12","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false}]} diff --git a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results2.json b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results2.json index 06c6883..a3615b5 100644 --- a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results2.json +++ b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results2.json @@ -1 +1 @@ -{"nodes":[{"attr":{"output_names":"dtype: DT_GRAPHS\nvalues {\n dtype: DT_FLOAT64\n str_val: \"output\"\n}\n","pad_mode":"dtype: DT_FLOAT64\nstr_val: \"same\"\n"},"independent_layout":false,"input":{"Default/conv1-Conv2d/Parameter[12]_2/conv1.weight":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[64,3,7,7]},"Default/conv1-Conv2d/Parameter[12]_2/x":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x1":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x10":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x2":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x3":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x4":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x5":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x6":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x7":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x8":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/conv1-Conv2d/Parameter[12]_2/x9":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]}},"name":"Default/conv1-Conv2d/Conv2D55","output":{"Default/bn1/Reshape[12]_1/Reshape6":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,64,112,112]}},"output_i":0,"proxy_input":{"Default/conv1-Conv2d/Parameter[12]_2":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"type":"Conv2D"},{"attr":{},"independent_layout":true,"input":{},"name":"Default/conv1-Conv2d/Parameter[12]_2","output":{"Default/conv1-Conv2d/Conv2D55":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[64,3,7,7]}},"output_i":0,"proxy_input":{},"proxy_output":{"Default/conv1-Conv2d/Conv2D55":{"edge_type":"data"}},"subnode_count":12,"type":"aggregation_scope"}]} \ No newline at end of file +{"nodes":[{"name":"Default/conv1-Conv2d/Conv2D55","type":"Conv2D","attr":{"output_names":"dtype: DT_GRAPHS\nvalues {\n dtype: DT_FLOAT64\n str_val: \"output\"\n}\n","pad_mode":"dtype: DT_FLOAT64\nstr_val: \"same\"\n"},"input":{"Default/conv1-Conv2d/Parameter[12]_2/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x1":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x2":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x3":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x4":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x5":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x6":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x7":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x8":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x9":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/x10":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/conv1-Conv2d/Parameter[12]_2/conv1.weight":{"shape":[64,3,7,7],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"}},"output":{"Default/bn1/Reshape[12]_1/Reshape6":{"shape":[1,64,112,112],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output_i":0,"proxy_input":{"Default/conv1-Conv2d/Parameter[12]_2":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/conv1-Conv2d/Parameter[12]_2","type":"aggregation_scope","attr":{},"input":{},"output":{"Default/conv1-Conv2d/Conv2D55":{"shape":[64,3,7,7],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"}},"output_i":0,"proxy_input":{},"proxy_output":{"Default/conv1-Conv2d/Conv2D55":{"edge_type":"data"}},"subnode_count":12,"independent_layout":true}]} diff --git a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results3.json b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results3.json index d76f713..cd8a2d9 100644 --- a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results3.json +++ b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results3.json @@ -1 +1 @@ -{"nodes":[{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add50":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape1","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add51":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape2","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add52":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape3","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add53":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape4","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/Add[5]_0/Add54":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,1024,14,14]}},"name":"Default/bn1/Reshape[12]_1/Reshape5","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/conv1-Conv2d/Conv2D55":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,64,112,112]}},"name":"Default/bn1/Reshape[12]_1/Reshape6","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape7","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape8","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape9","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape10","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape11","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"},{"attr":{},"independent_layout":false,"input":{"Default/bn1/x":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[1,3,224,224]}},"name":"Default/bn1/Reshape[12]_1/Reshape12","output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Reshape"}]} \ No newline at end of file +{"nodes":[{"name":"Default/bn1/Reshape[12]_1/Reshape1","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add50":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape2","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add51":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape3","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add52":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape4","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add53":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape5","type":"Reshape","attr":{},"input":{"Default/bn1/Add[5]_0/Add54":{"shape":[1,1024,14,14],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape6","type":"Reshape","attr":{},"input":{"Default/conv1-Conv2d/Conv2D55":{"shape":[1,64,112,112],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape7","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape8","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape9","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape10","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape11","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1/Reshape[12]_1/Reshape12","type":"Reshape","attr":{},"input":{"Default/bn1/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output":{},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false}]} diff --git a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results4.json b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results4.json index 4a65daa..8185035 100644 --- a/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results4.json +++ b/tests/ut/datavisual/processors/graph_results/test_get_nodes_success_expected_results4.json @@ -1 +1 @@ -{"nodes":[{"attr":{},"independent_layout":false,"input":{"Default/bn1-BatchNorm2d/Parameter[22]_3/x":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x1":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x10":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x2":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x3":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x4":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x5":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x6":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x7":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x8":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x9":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/cst13":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[]}},"name":"Default/bn1-BatchNorm2d/tuple_getitem56","output":{"Default/bn1/Add[5]_0/Add53":{"data_type":"DT_STRING","edge_type":"data","independent_layout":false,"shape":[1,128,28,28]}},"output_i":0,"proxy_input":{"Default/bn1-BatchNorm2d/Parameter[22]_3":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"type":"tuple_getitem"},{"attr":{},"independent_layout":false,"input":{"Default/bn1-BatchNorm2d/Parameter[22]_3/conv1.weight":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[64,3,7,7]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x11":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x12":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x13":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x14":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x15":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x16":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x17":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x18":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x19":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/Parameter[22]_3/x20":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]},"Default/bn1-BatchNorm2d/cst25":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[]}},"name":"Default/bn1-BatchNorm2d/tuple_getitem105","output":{},"output_i":0,"proxy_input":{"Default/bn1-BatchNorm2d/Parameter[22]_3":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"type":"tuple_getitem"},{"attr":{},"independent_layout":true,"input":{},"name":"Default/bn1-BatchNorm2d/Parameter[22]_3","output":{"Default/bn1-BatchNorm2d/tuple_getitem105":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[64,3,7,7]},"Default/bn1-BatchNorm2d/tuple_getitem56":{"data_type":"","edge_type":"data","independent_layout":true,"shape":[1,3,224,224]}},"output_i":0,"proxy_input":{},"proxy_output":{"Default/bn1-BatchNorm2d/tuple_getitem105":{"edge_type":"data"},"Default/bn1-BatchNorm2d/tuple_getitem56":{"edge_type":"data"}},"subnode_count":22,"type":"aggregation_scope"},{"attr":{"cst13":"dtype: DT_INT32\nint_val: 0\n"},"independent_layout":false,"input":{},"name":"Default/bn1-BatchNorm2d/cst13","output":{"Default/bn1-BatchNorm2d/tuple_getitem56":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[]}},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Const"},{"attr":{"cst25":"dtype: DT_INT32\nint_val: 0\n"},"independent_layout":false,"input":{},"name":"Default/bn1-BatchNorm2d/cst25","output":{"Default/bn1-BatchNorm2d/tuple_getitem105":{"data_type":"","edge_type":"data","independent_layout":false,"shape":[]}},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"type":"Const"}]} \ No newline at end of file +{"nodes":[{"name":"Default/bn1-BatchNorm2d/tuple_getitem56","type":"tuple_getitem","attr":{},"input":{"Default/bn1-BatchNorm2d/Parameter[22]_3/x":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x1":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x2":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x3":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x4":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x5":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x6":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x7":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x8":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x9":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x10":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/cst13":{"shape":[],"edge_type":"data","independent_layout":false,"data_type":""}},"output":{"Default/bn1/Add[5]_0/Add53":{"shape":[1,128,28,28],"edge_type":"data","independent_layout":false,"data_type":"DT_STRING"}},"output_i":0,"proxy_input":{"Default/bn1-BatchNorm2d/Parameter[22]_3":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1-BatchNorm2d/tuple_getitem105","type":"tuple_getitem","attr":{},"input":{"Default/bn1-BatchNorm2d/Parameter[22]_3/x11":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x12":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x13":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x14":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x15":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x16":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x17":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x18":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x19":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/x20":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/Parameter[22]_3/conv1.weight":{"shape":[64,3,7,7],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/cst25":{"shape":[],"edge_type":"data","independent_layout":false,"data_type":""}},"output":{},"output_i":0,"proxy_input":{"Default/bn1-BatchNorm2d/Parameter[22]_3":{"edge_type":"data"}},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1-BatchNorm2d/Parameter[22]_3","type":"aggregation_scope","attr":{},"input":{},"output":{"Default/bn1-BatchNorm2d/tuple_getitem56":{"shape":[1,3,224,224],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"},"Default/bn1-BatchNorm2d/tuple_getitem105":{"shape":[64,3,7,7],"edge_type":"data","independent_layout":true,"data_type":"DT_STRING"}},"output_i":0,"proxy_input":{},"proxy_output":{"Default/bn1-BatchNorm2d/tuple_getitem56":{"edge_type":"data"},"Default/bn1-BatchNorm2d/tuple_getitem105":{"edge_type":"data"}},"subnode_count":22,"independent_layout":true},{"name":"Default/bn1-BatchNorm2d/cst13","type":"Const","attr":{"cst13":"dtype: DT_INT32\nint_val: 0\n"},"input":{},"output":{"Default/bn1-BatchNorm2d/tuple_getitem56":{"shape":[],"edge_type":"data","independent_layout":false,"data_type":""}},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false},{"name":"Default/bn1-BatchNorm2d/cst25","type":"Const","attr":{"cst25":"dtype: DT_INT32\nint_val: 0\n"},"input":{},"output":{"Default/bn1-BatchNorm2d/tuple_getitem105":{"shape":[],"edge_type":"data","independent_layout":false,"data_type":""}},"output_i":0,"proxy_input":{},"proxy_output":{},"subnode_count":0,"independent_layout":false}]} -- GitLab