Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【SCU】【Paddle Tensor No.24】docs: Add docs for paddle.matrix_transpose, paddle.linalg.matrix_transpose #6970

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
27 changes: 27 additions & 0 deletions docs/api/paddle/linalg/matrix_transpose_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _cn_api_paddle_linalg_matrix_transpose:

matrix_transpose
-------------------------------

.. py:function:: paddle.linalg.matrix_transpose(x, name=None)

对输入张量 `x` 的最后两个维度进行转置。

.. note::
如果 `n` 是 `x` 的维数,则 `paddle.linalg.matrix_transpose(x)` 等同于 `x.transpose([0, 1, ..., n-2, n-1])` 。

参数
::::::::::::

- **x** (Tensor) - 输入 Tensor,数据类型为 float32,float64,int32 或者 int64。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::

``最后两个维度进行转置后的结果`` `Tensor`,数据类型与 `x` 相同。
PolaKuma marked this conversation as resolved.
Show resolved Hide resolved

代码示例
::::::::::::

COPY-FROM: paddle.linalg.matrix_transpose
27 changes: 27 additions & 0 deletions docs/api/paddle/matrix_transpose_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _cn_api_paddle_matrix_transpose:

matrix_transpose
-------------------------------

.. py:function:: paddle.matrix_transpose(x, name=None)

对输入张量 `x` 的最后两个维度进行转置。

.. note::
如果 `n` 是 `x` 的维数,则 `paddle.matrix_transpose(x)` 等同于 `x.transpose([0, 1, ..., n-2, n-1])` 。

参数
::::::::::::

- **x** (Tensor) - 输入 Tensor,数据类型为 float32,float64,int32 或者 int64。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::

``最后两个维度进行转置后的结果`` `Tensor`,数据类型与 `x` 相同。
PolaKuma marked this conversation as resolved.
Show resolved Hide resolved

代码示例
::::::::::::

COPY-FROM: paddle.matrix_transpose