You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace deprecated libtorch APIs with torch::linalg equivalents
- THSTensor_cholesky: Replace tensor->cholesky(upper) with torch::linalg_cholesky,
using .mH() for upper-triangular results
- THSTensor_lu_solve: Replace tensor->lu_solve() with torch::linalg_lu_solve
- Fix THSLinalg_lu_solve naming bug (was incorrectly named THSTensor_lu_solve)
- Add [Obsolete] attributes to C# wrappers for cholesky() and lu_solve()
- Update tests to use linalg.lu_solve instead of deprecated lu_solve
Copy file name to clipboardExpand all lines: src/TorchSharp/Tensor/Tensor.LinearAlgebra.cs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,7 @@ public Tensor tensordot(Tensor b, long dims = 2)
64
64
/// </summary>
65
65
/// <param name="upper">If upper is true, the returned matrix U is upper-triangular. If upper is false, the returned matrix L is lower-triangular</param>
66
66
/// <returns></returns>
67
+
[Obsolete("torch.cholesky is deprecated in favor of torch.linalg.cholesky and will be removed in a future release. Use torch.linalg.cholesky instead.",false)]
[Obsolete("torch.cholesky is deprecated in favor of torch.linalg.cholesky and will be removed in a future release. Use torch.linalg.cholesky instead.",false)]
@@ -250,6 +253,7 @@ public static (Tensor A_LU, Tensor? pivots, Tensor? infos) lu(Tensor A, bool piv
250
253
/// The pivots of the LU factorization from torch.lu() of size (∗,m), where *∗ is zero or more batch dimensions.
251
254
/// The batch dimensions of LU_pivots must be equal to the batch dimensions of LU_data.</param>
252
255
/// <returns></returns>
256
+
[Obsolete("torch.lu_solve is deprecated in favor of torch.linalg.lu_solve and will be removed in a future release. Use torch.linalg.lu_solve(LU, pivots, B) instead.",false)]
Copy file name to clipboardExpand all lines: src/TorchSharp/Tensor/torch.cs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,10 @@ public static partial class torch
16
16
/// <param name="input">The input matrix</param>
17
17
/// <param name="upper">If upper is true, the returned matrix U is upper-triangular. If upper is false, the returned matrix L is lower-triangular</param>
18
18
/// <returns></returns>
19
+
[Obsolete("torch.cholesky is deprecated in favor of torch.linalg.cholesky and will be removed in a future release. Use torch.linalg.cholesky instead.",false)]
0 commit comments