nflows
nflows copied to clipboard
Solve torch.triangular_solve deprecation warning
From PyTorch 1.11 docs: link
UserWarning: torch.triangular_solve is deprecated in favor of torch.linalg.solve_triangular and will be removed in a future PyTorch release. torch.linalg.solve_triangular has its arguments reversed and does not return a copy of one of the inputs. X = torch.triangular_solve(B, A).solution should be replaced with X = torch.linalg.solve_triangular(A, B).
This PR swaps in the new torch.linalg.solve_triangular() (see docs) with the arguments correctly swapped. I tested it for sample generation in my use case and everything works fine without any UserWarning!
Cheers, Francesco