mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-08 17:17:15 +00:00
skip optional inputs for scan subgraphs (#3349)
* skip optional inputs for scan subgraphs We may have cases where the subgraph has optionial inputs that appear in both subgraph's input and initializer, but not in the node's input. In such cases, the input model might be invalid, but let's not choke on it. Instead, let's issue a warning, skip the optional inputs, and keep going forward. * address CR feedback
This commit is contained in:
parent
c3cea486d0
commit
33b5010e62
1 changed files with 5 additions and 1 deletions
|
|
@ -903,7 +903,11 @@ class SymbolicShapeInference:
|
|||
scan_input_axes = get_attribute(node, 'scan_input_axes', [0]*num_scan_inputs)
|
||||
num_scan_states = len(node.input) - num_scan_inputs
|
||||
scan_input_axes = [handle_negative_axis(ax, self._get_shape_rank(node, i + num_scan_states)) for i, ax in enumerate(scan_input_axes)]
|
||||
for i, si in enumerate(subgraph.input):
|
||||
# We may have cases where the subgraph has optionial inputs that appear in both subgraph's input and initializer,
|
||||
# but not in the node's input. In such cases, the input model might be invalid, but let's skip those optional inputs.
|
||||
assert len(subgraph.input) >= len(node.input)
|
||||
subgraph_inputs = subgraph.input[:len(node.input)]
|
||||
for i, si in enumerate(subgraph_inputs):
|
||||
subgraph_name = si.name
|
||||
si.CopyFrom(self.known_vi_[node.input[i]])
|
||||
if i >= num_scan_states:
|
||||
|
|
|
|||
Loading…
Reference in a new issue