mindspore.ops.lu_solve
- mindspore.ops.lu_solve(b, LU_data, LU_pivots)[source]
Compute the solution to a system of linear equations
.Note
b of shape
, LU_data of shape , LU_pivots of shape , where means batch dimensions.
Warning
This is an experimental API that is subject to change or deletion.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> b = mindspore.tensor([[1.], [3.], [3.]]) >>> LU_data = mindspore.tensor([[2., 1., 1.], [0.5, 1., 1.5], [0.5, 0., 2.5]]) >>> LU_pivots = mindspore.tensor(([2, 2, 3]), mindspore.int32) >>> y = mindspore.ops.lu_solve(b, LU_data, LU_pivots) >>> print(y) [[ 1.9000001] [-1.4000001] [ 0.6 ]]