mlverse / torch

R Interface to Torch
https://torch.mlverse.org
Other
490 stars 64 forks source link

torch_triangular_solve function deprecation warning #1146

Closed julien-hec closed 5 months ago

julien-hec commented 6 months ago

Hello,

I want to start by thanking you for all the good work on this library.

I have a question regarding the triangular_solve bindings. I see in the issue #1076 and its related PR #1077, that we moved from torch_triangular_solve to torch_linalg_solve_triangular in the distributions-multivariate_normal.R file. I think this was because of the following deprecation warning:

[W BatchLinearAlgebra.cpp:2197] Warning: torch.triangular_solve is deprecated in favor of torch.linalg.solve_triangularand will be removed in a future PyTorch release.

I wanted to know if it was in the future plans to make the torch_linalg_solve_triangular a public binding for the torch interface and add some documentations to it, since, for now, we can only access it privately with :::. The publicly available function torch_triangular_solve still gives warning (as of 0.12.0), so maybe we could update its documentation (man/torch_triangular_solve.Rd) to reflect that or move to the linalg implementation?

The following is an example if it ever helps:

a <- torch_randn(c(3, 3))$triu_()
b <- torch_randn(3, 4)
# The following gives a warning on first execution
torch_triangular_solve(b, a, upper=TRUE)[[1]]
# The following is not publicly exposed but doesn't give a warning
torch:::torch_linalg_solve_triangular(a, b, upper=TRUE)
# The two above statements return the same results

Many thanks in advance for your assistance.

dfalbel commented 5 months ago

Should be solved in #1150