RuntimeError: false INTERNAL ASSERT FAILED at “/opt/conda/conda-bld/pytorch_1682343995622/work/aten/src/ATen/native/BatchLinearAlgebra.cpp”:1538, please report a bug to PyTorch. torch.linalg.lstsq: Argument 6 has illegal value. Most certainly there is a bug in the implementation calling the backend library.
The RuntimeError appear when run following code:
import torch
x = torch.arange(10, 50, step=1, dtype=torch.float32)
y = torch.exp(-((x-100)/(0.60056120439323*100))**2)
y = 100 * y + 10 * torch.randn(x.shape)
y = torch.log(y)
x = x.unsqueeze(dim=0)
y = y.unsqueeze(dim=0)
x = torch.linalg.vander(x, N = 3).flip(-1)
coefficients = torch.linalg.lstsq(x, y).solution
print(coefficients)
the code works fine if without add noise to data y, that is remove the line “y = 100 * y + 10 * torch.randn(x.shape)”
torch.version == 2.0.1