Browse Source

Pre Merge pull request !634 from 韩健/hanjian

pull/634/MERGE
韩健 Gitee 3 years ago
parent
commit
e46e225107
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      parser/onnx/onnx_parser.cc

+ 6
- 7
parser/onnx/onnx_parser.cc View File

@@ -671,13 +671,12 @@ Status OnnxModelParser::ParseAllNodeProto(ge::onnx::GraphProto &onnx_graph, ge::
}

Status OnnxModelParser::GetGraphInputs(ge::onnx::GraphProto &onnx_graph, std::vector<ge::Operator> &input_ops) {
if (input_node_names_.empty()) {
// subgraph might not have input, we use constant nodes as the start nodes of graph
for (int i = 0; i < onnx_graph.node_size(); i++) {
ge::onnx::NodeProto *node = onnx_graph.mutable_node(i);
if (node->op_type() == kOpTypeConstant) {
input_node_names_.emplace_back(node->name());
}
// subgraph might not have input, or isolated const nodes exist in the graph,
// we use constant nodes as the start nodes of graph
for (int i = 0; i < onnx_graph.node_size(); i++) {
ge::onnx::NodeProto *node = onnx_graph.mutable_node(i);
if (node->op_type() == kOpTypeConstant) {
input_node_names_.emplace_back(node->name());
}
}
for (auto in_name : input_node_names_) {


Loading…
Cancel
Save