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
6 changes: 5 additions & 1 deletion backends/mlx/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2272,9 +2272,13 @@ def _getitem_handler(P: MLXProgramBuilder, n: Node) -> Slot:
require_kwargs(P.kwargs(n), set(), "operator.getitem")
a, idx = args
out = P.make_or_get_slot(n)
# When the multi-output parent is left outside the partition, the partitioner
# feeds this getitem the already-selected element as a single boundary-input
# Slot (not the source tuple). In that case forward it directly.
src = a[idx] if isinstance(a, (tuple, list)) else a
P.emit(
IdCopyNode(
x=P.slot_to_tid(a[idx]),
x=P.slot_to_tid(src),
out=P.slot_to_tid(out),
)
)
Expand Down
Loading