# tensorplay.functional.lu_solve Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.lu_solve.html ```python tensorplay.functional.lu_solve(b, LU_data, LU_pivots, *, out=None) → Tensor ``` Returns the LU solve of the linear system $Ax = b$ using the partially pivoted LU factorization of A from lu_factor(). This function supports float, double, cfloat and cdouble dtypes for input. > **Warning** > > tensorplay.lu_solve() is deprecated in favor of tensorplay.linalg.lu_solve(). X = tensorplay.lu_solve(B, LU, pivots) should be replaced with @@TPBLOCK_0@@ Parameters: - b ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the RHS tensor of size $(*, m, k)$, where $*$ is zero or more batch dimensions. - LU_data ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the pivoted LU factorization of A from lu_factor() of size $(*, m, m)$, where $*$ is zero or more batch dimensions. - LU_pivots (IntTensor) – the pivots of the LU factorization from lu_factor() of size $(*, 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](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> A = tensorplay.randn(2, 3, 3) >>> b = tensorplay.randn(2, 3, 1) >>> LU, pivots = tensorplay.linalg.lu_factor(A) >>> x = tensorplay.lu_solve(b, LU, pivots) >>> tensorplay.dist(A @ x, b) tensor(1.00000e-07 * 2.8312) ```