forked from PaddlePaddle/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add doc for as_complex, as_real (PaddlePaddle#4126)
* add doc for view_as_complex, view_as_real * rename api * fix typos, add to index * add more details in doc of as_real
- Loading branch information
Feiyu Chan
authored
Dec 24, 2021
1 parent
83d23e1
commit f54db24
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,8 @@ Methods | |
argmax | ||
argmin | ||
argsort | ||
as_complex | ||
as_real | ||
asin | ||
astype | ||
atan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. _cn_api_paddle_as_complex: | ||
|
||
as_complex | ||
------------------------------- | ||
|
||
.. py:function:: paddle.as_complex(x, name=None) | ||
将实数 Tensor 转为复数 Tensor. | ||
|
||
输入 Tensor 的数据类型是 'float32' 或者 'float64',输出 Tensor 的数据类型相应为 'complex64' 或者 'complex128'. | ||
|
||
输入 Tensor 的形状是 ``(*, 2)`` (其中 ``*`` 表示任意形状),亦即,输入的最后一维的大小必须是 2, 这对应着复数的实部和虚部。输出 Tensor 的形状是 ``(*,)``. | ||
|
||
参数 | ||
::::::::: | ||
- x (Tensor) - 输入 Tensor,数据类型为:float32 或 float64。 | ||
- name (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
返回 | ||
::::::::: | ||
输出 Tensor,数据类型是 'complex64' 或 'complex128', 与 ``x`` 的数值精度一致。 | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.as_complex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. _cn_api_paddle_as_real: | ||
|
||
as_real | ||
------------------------------- | ||
|
||
.. py:function:: paddle.as_real(x, name=None) | ||
将复数 Tensor 转为实数 Tensor. | ||
|
||
输入 Tensor 的数据类型是 'complex64' 或者 'complex128',输出 Tensor 的数据类型相应为 'float32' 或者 'float64'. | ||
|
||
输入 Tensor 的形状是 ``(*,)`` (其中 ``*`` 表示任意形状),输出 Tensor 的形状是 ``(*, 2)``,亦即,输出的形状是在输入形状后附加一个 ``2``,因为一个复数的实部和虚部分别表示为一个实数。 | ||
|
||
参数 | ||
::::::::: | ||
- x (Tensor) - 输入 Tensor,数据类型为:'complex64' 或 'complex128'。 | ||
- name (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
返回 | ||
::::::::: | ||
输出 Tensor,数据类型是 'float32' 或 'float64', 与 ``x`` 的数值精度一致。 | ||
|
||
代码示例 | ||
::::::::: | ||
|
||
COPY-FROM: paddle.as_real |