Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions onnxscript/optimizer/_constant_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,9 @@ def split_to_sequence(node: ir.Node, op, state: OptimizerState) -> ReturnValue:
This allows downstream `SequenceAt` users to be replaced by `split_x` accordingly.
"""
input = node.inputs[0]
if len(node.inputs) == 1:
# split is not provided
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When split is not provided it is a scalar 1. Can we use this info?

Copy link
Copy Markdown
Contributor Author

@titaiwangms titaiwangms Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? The issue @xadupre brought up was only one input. model id: facebook/sam-vit-base, so it hit indexerror.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return op.SplitToSequence(self, axis=dim, keepdims=False)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably came from here

return None
split = node.inputs[1]
output = node.outputs[0]

Expand Down
Loading