mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-09 00:30:53 +00:00
[VITISAI] fix out of bound error on graph with loop (#17065)
### Description <!-- Describe your changes. --> Check the bound of the node_get_inputs for out of bound error. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Model with loop would encounter this error. Currrent we do not support custom op for loop. So, ideally it would throw an error and fall back to CPU evalution.
This commit is contained in:
parent
f17efb5c7b
commit
e951f837e4
1 changed files with 5 additions and 1 deletions
|
|
@ -21,7 +21,11 @@ vaip_core::DllSafe<std::vector<NodeInput>> node_get_inputs(const Node& node) {
|
|||
}
|
||||
for (auto iter = node.InputEdgesBegin(); iter != node.InputEdgesEnd();
|
||||
++iter) {
|
||||
ret[iter->GetDstArgIndex()].node = &iter->GetNode();
|
||||
auto dst_idx = static_cast<size_t>(iter->GetDstArgIndex());
|
||||
if (dst_idx < ret.size()) {
|
||||
// ignore implicit nodes.
|
||||
ret[dst_idx].node = &iter->GetNode();
|
||||
}
|
||||
}
|
||||
return vaip_core::DllSafe(ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue