Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions python/paddle/tensor/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3428,19 +3428,21 @@ def lu_solve(
Tensor, the same data type as the `b` and `lu`.

Examples:
>>> import paddle
>>> import numpy as np

>>> A = paddle.to_tensor([[3, 1], [1, 2]], dtype="float64")
>>> b = paddle.to_tensor([[9, 8], [9, 8]], dtype="float64")
>>> lu, p = paddle.linalg.lu(A)
>>> x = paddle.lu_solve(b, lu, p)
>>> paddle.allclose(A @ x, b)

>>> print(x)
Tensor(shape=[2, 2], dtype=float64, place=Place(cpu), stop_gradient=True,
[[1.80000000, 1.60000000],
[3.60000000, 3.20000000]])
.. code-block:: python

>>> import paddle
>>> import numpy as np

>>> A = paddle.to_tensor([[3, 1], [1, 2]], dtype="float64")
>>> b = paddle.to_tensor([[9, 8], [9, 8]], dtype="float64")
>>> lu, p = paddle.linalg.lu(A)
>>> x = paddle.linalg.lu_solve(b, lu, p)
>>> paddle.allclose(A @ x, b)

>>> print(x)
Tensor(shape=[2, 2], dtype=float64, place=Place(cpu), stop_gradient=True,
[[1.80000000, 1.60000000],
[3.60000000, 3.20000000]])
"""
if b.ndim < 2:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3081,7 +3081,7 @@ def tensor_split(
.. image:: https://githubraw.cdn.bcebos.com/PaddlePaddle/docs/develop/docs/images/api_legend/tensor_split/tensor_split-5.png

.. code-block:: python
:name: tensor-spilt-example-5
:name: tensor-split-example-5

>>> import paddle

Expand Down
Loading