Commit 7dade54
Fix Nx.linspace crash with n=1
When n=1 and endpoint=true (default), the divisor is n-1=0, causing
a divide-by-zero. Special-case n=1 to return start value directly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 11c6cc5 commit 7dade54
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16800 | 16800 | | |
16801 | 16801 | | |
16802 | 16802 | | |
| 16803 | + | |
| 16804 | + | |
| 16805 | + | |
| 16806 | + | |
| 16807 | + | |
| 16808 | + | |
| 16809 | + | |
| 16810 | + | |
16803 | 16811 | | |
16804 | 16812 | | |
16805 | 16813 | | |
| |||
16823 | 16831 | | |
16824 | 16832 | | |
16825 | 16833 | | |
| 16834 | + | |
| 16835 | + | |
| 16836 | + | |
| 16837 | + | |
| 16838 | + | |
| 16839 | + | |
| 16840 | + | |
| 16841 | + | |
| 16842 | + | |
16826 | 16843 | | |
16827 | 16844 | | |
16828 | 16845 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3071 | 3071 | | |
3072 | 3072 | | |
3073 | 3073 | | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
3074 | 3082 | | |
3075 | 3083 | | |
3076 | 3084 | | |
| |||
0 commit comments