Commit 1d319b4
Fix Nx.gather error message for scalar indices
Nx.gather(tensor, scalar) gave an unhelpful Erlang error because
indexed_axes tried to access elem({}, -1) before the shape validation
in Nx.Shape.gather could fire. Moved the scalar check earlier.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 11c6cc5 commit 1d319b4
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14594 | 14594 | | |
14595 | 14595 | | |
14596 | 14596 | | |
| 14597 | + | |
| 14598 | + | |
| 14599 | + | |
14597 | 14600 | | |
14598 | 14601 | | |
14599 | 14602 | | |
| |||
14602 | 14605 | | |
14603 | 14606 | | |
14604 | 14607 | | |
| 14608 | + | |
| 14609 | + | |
| 14610 | + | |
| 14611 | + | |
14605 | 14612 | | |
14606 | 14613 | | |
14607 | 14614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2863 | 2863 | | |
2864 | 2864 | | |
2865 | 2865 | | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
2866 | 2872 | | |
2867 | 2873 | | |
2868 | 2874 | | |
| |||
0 commit comments