Skip to content
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion onnxscript/function_libs/torch_lib/ops/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8957,7 +8957,11 @@ def aten_unbind(self: TTensor, dim: int = 0) -> Sequence[TTensor]:
if isinstance(self.shape[dim], int) and not version_utils.torch_older_than("2.7"):
# We can create a definitive split op if the input shape is static
# Only torch>=2.7 supports correctly generating the correct number of outputs for Split
outputs = op.Split(self, axis=dim, num_outputs=self.shape[dim])
num_outputs = self.shape[dim]
outputs = op.Split(self, axis=dim, num_outputs=num_outputs)
if num_outputs == 1:
outputs = [outputs]
Comment thread
justinchuby marked this conversation as resolved.
Outdated
Comment thread
justinchuby marked this conversation as resolved.
Outdated

return [op.Squeeze(out, [dim]) for out in outputs]

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