HoroPCA icon indicating copy to clipboard operation
HoroPCA copied to clipboard

replace torch.solve with torch.linalg.solve

Open ez2rok opened this issue 1 year ago • 0 comments

Running the code in this repo results in errors because this repo calls torch.solve, a function which is now deprecated. In this pull request, I replace torch.solve with the updated torch.linalg.solve function so that the code here can run smoothly.

A bit more detail: This repo calls torch.solve several times. However, since the release of PyTorch 1.9, torch.solve has been replaced with torch.linalg.solve. Note that the order of the arguments is reversed in the new torch.linalg.solve function. For example, torch.solve(b, A) must become torch.linalg.solve(A, b).

For more info, one can check the order of the arguments in the old torch.solve documentation compared to the new torch.linalg.solve documentation.

Anyway, I updated this repo to use the newer torch.linalg.solve. I also made sure to swap the order of the arguments. Now everything should work. Cheers!

ez2rok avatar Jun 28 '23 11:06 ez2rok