Skip to content

Commit

Permalink
【SCU】【Paddle Tensor No.24】docs: Add docs for paddle.matrix_transpose,…
Browse files Browse the repository at this point in the history
… paddle.linalg.matrix_transpose (PaddlePaddle#6970)

* add_matrix_transpose

* fix codestyle

* Update docs/api/paddle/matrix_transpose_cn.rst

Co-authored-by: HydrogenSulfate <[email protected]>

* Update docs/api/paddle/linalg/matrix_transpose_cn.rst

Co-authored-by: HydrogenSulfate <[email protected]>

---------

Co-authored-by: HydrogenSulfate <[email protected]>
  • Loading branch information
2 people authored and WSBG committed Nov 27, 2024
1 parent ed84570 commit 0e2f75e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
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` 相同。

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

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` 相同。

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

COPY-FROM: paddle.matrix_transpose

0 comments on commit 0e2f75e

Please sign in to comment.