Browse Source

!1285 Remove MindConverter redundant code for external developer's contribution

From: @liangtianshu
Reviewed-by: @ouwenchang,@yelihua
Signed-off-by: @yelihua
pull/1285/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
b11bce1f58
1 changed files with 1 additions and 8 deletions
  1. +1
    -8
      mindinsight/mindconverter/graph_based_converter/third_party_graph/onnx_utils.py

+ 1
- 8
mindinsight/mindconverter/graph_based_converter/third_party_graph/onnx_utils.py View File

@@ -502,14 +502,7 @@ class OnnxDataLoader:

def _parse_graph(self):
"""Parse ONNX Graph Info For usage in generator."""
graph_inputs = [inp.name for inp in self.graph.input]
graph_outputs = [out.name for out in self.graph.output]
for output_node in self.output_nodes:
if output_node not in graph_outputs:
raise ValueError(f"Unexpected Node {output_node} detected which should not be a graph output.")
for graph_inp in graph_inputs:
if graph_inp not in self.input_nodes.keys():
raise ValueError(f"{graph_inp} is one of the graph inputs but user does not provide it.")
self._global_context.onnx_graph_info['graph_inputs'] = self.input_nodes.keys()
self._global_context.onnx_graph_info['graph_outputs'] = graph_outputs

@@ -521,7 +514,7 @@ class OnnxDataLoader:
if output_node not in graph_outputs:
raise ModelLoadingError(f"Unexpected Node {output_node} detected which should not be a graph output.")
for graph_inp in graph_inputs:
if graph_inp not in self.input_nodes.keys():
if graph_inp not in self.input_nodes:
raise ModelLoadingError(f"{graph_inp} is one of the graph inputs but user does not provide it.")

def initialize(self):


Loading…
Cancel
Save