mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-25 19:48:11 +00:00
subgraph parse error fix (#2254)
This commit is contained in:
parent
6a0ee7eff6
commit
c7599d0705
1 changed files with 20 additions and 19 deletions
|
|
@ -296,28 +296,29 @@ std::vector<std::unique_ptr<ComputeCapability>> MKLDNNExecutionProvider::GetCapa
|
|||
bool create_subgraph = false;
|
||||
bool break_loop = false;
|
||||
while (!break_loop) {
|
||||
if (temp_index > graph_viewer.MaxNodeIndex())
|
||||
break_loop = true;
|
||||
|
||||
auto next_node = graph_viewer.GetNode(temp_index);
|
||||
while (next_node == nullptr) {
|
||||
if (temp_index < graph_viewer.MaxNodeIndex()) {
|
||||
auto next_node = graph_viewer.GetNode(temp_index);
|
||||
while (next_node == nullptr) {
|
||||
temp_index++;
|
||||
next_node = graph_viewer.GetNode(temp_index);
|
||||
}
|
||||
if (next_node->GetInputEdgesCount() == node->GetOutputEdgesCount()) {
|
||||
// if all nodes in the branch loop are mkldnn nodes
|
||||
// then continue with adding nodes to sub-graph
|
||||
break_loop = true;
|
||||
}
|
||||
// inner nodes. if inner nodes are not mkldnn nodes
|
||||
// create subgraph (inception v2)
|
||||
auto sub_it = mkldnn_ops_.find(next_node->OpType());
|
||||
if (sub_it == mkldnn_ops_.end()) {
|
||||
// break and create a sub-graph
|
||||
break_loop = true;
|
||||
create_subgraph = true;
|
||||
}
|
||||
temp_index++;
|
||||
next_node = graph_viewer.GetNode(temp_index);
|
||||
}
|
||||
if (next_node->GetInputEdgesCount() == node->GetOutputEdgesCount()) {
|
||||
// if all nodes in the branch loop are mkldnn nodes
|
||||
// then continue with adding nodes to sub-graph
|
||||
} else {
|
||||
break_loop = true;
|
||||
}
|
||||
// inner nodes. if inner nodes are not mkldnn nodes
|
||||
// create subgraph (inception v2)
|
||||
auto sub_it = mkldnn_ops_.find(next_node->OpType());
|
||||
if (sub_it == mkldnn_ops_.end()) {
|
||||
// break and create a sub-graph
|
||||
break_loop = true;
|
||||
create_subgraph = true;
|
||||
}
|
||||
temp_index++;
|
||||
}
|
||||
if (create_subgraph) {
|
||||
CreateMetaDef(graph_viewer, subgraph_attributes, subgraph_ptr, sub_var, result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue