trunk/98a0190638f271ea6e37e7e5891ea9823d11baae: Handle empty linalg.lstsq inputs in shared code (#199696)
- PyTorch: 2180 events in the last 90 days
- PyTorch: 2151th Release in the last 90 days
- Previous: earlier the same day · ciflow/trunk/200573
What happened
linalg.lstsq handed degenerate shapes straight to the backend, so each one inherited LAPACK's quick-return behavior, and those disagree with each other and with the math: gels zeroes B when min(m, n, nrhs) == 0 , so for n == 0 CPU reported zero residuals instead of ||B||^2 (and the backward, which assumes the true residual, disagreed with them). gelsy sets rank = 0 when nrhs == 0 , although the rank of A doesn't dep…
Summary assembled by rule from the sources below