A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pytorch.org/docs/stable/generated/torch.lu_solve.html below:

torch.lu_solve — PyTorch 2.7 documentation

torch.lu_solve
torch.lu_solve(b, LU_data, LU_pivots, *, out=None) Tensor

Returns the LU solve of the linear system A x = b Ax = b Ax=b using the partially pivoted LU factorization of A from lu_factor().

This function supports float, double, cfloat and cdouble dtypes for input.

Parameters
  • b (Tensor) – the RHS tensor of size ( ∗ , m , k ) (*, m, k) (,m,k), where ∗ * is zero or more batch dimensions.

  • LU_data (Tensor) – the pivoted LU factorization of A from lu_factor() of size ( ∗ , m , m ) (*, m, m) (,m,m), where ∗ * is zero or more batch dimensions.

  • LU_pivots (IntTensor) – the pivots of the LU factorization from lu_factor() of size ( ∗ , m ) (*, m) (,m), where ∗ * is zero or more batch dimensions. The batch dimensions of LU_pivots must be equal to the batch dimensions of LU_data.

Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> A = torch.randn(2, 3, 3)
>>> b = torch.randn(2, 3, 1)
>>> LU, pivots = torch.linalg.lu_factor(A)
>>> x = torch.lu_solve(b, LU, pivots)
>>> torch.dist(A @ x, b)
tensor(1.00000e-07 *
       2.8312)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4