Skip to content

Commit cec5396

Browse files
authored
Do not try to fold op.SplitToSequence when split is None (#2550)
split is an optional input to op.SplitToSequence.
1 parent 9036fab commit cec5396

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

onnxscript/optimizer/_constant_folding.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ def split_to_sequence(node: ir.Node, op, state: OptimizerState) -> ReturnValue:
784784
This allows downstream `SequenceAt` users to be replaced by `split_x` accordingly.
785785
"""
786786
input = node.inputs[0]
787+
if len(node.inputs) == 1:
788+
# split is not provided
789+
return None
787790
split = node.inputs[1]
788791
output = node.outputs[0]
789792

0 commit comments

Comments
 (0)