mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-27 22:45:57 +00:00
A subgraph may have no inputs (e.g. subgraph in If has no explicit inputs) or value infos (e.g. a subgraph with just an If node in it). (#1083)
It should always have outputs but in case it doesn't (nothing fails currently if it doesn't even though that makes it meaningless) make sure it also has a node.
This commit is contained in:
parent
206278ca44
commit
35c5c4d418
1 changed files with 3 additions and 4 deletions
|
|
@ -47,9 +47,8 @@ static Status MergeShapeInfo(const std::string& output_name,
|
|||
}
|
||||
|
||||
static bool GraphLoadedFromModelFile(const GraphProto* graph_proto) {
|
||||
return graph_proto && (graph_proto->input_size() != 0 ||
|
||||
graph_proto->output_size() != 0 ||
|
||||
graph_proto->value_info_size() != 0);
|
||||
return graph_proto && (graph_proto->node_size() != 0 ||
|
||||
graph_proto->output_size() != 0);
|
||||
}
|
||||
|
||||
// there are some known invalid usages of dim_param and dim_value. remove them from the TypeProto so that
|
||||
|
|
@ -1353,7 +1352,7 @@ Status Graph::InferAndVerifySubgraphTypes(const Node& node, Graph& subgraph,
|
|||
" inputs and requires ", num_required_subgraph_inputs,
|
||||
" inputs. Either provide all subgraph inputs, or just the required inputs.");
|
||||
}
|
||||
|
||||
|
||||
subgraph_inputs = &required_subgraph_inputs;
|
||||
num_subgraph_inputs = num_required_subgraph_inputs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue