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
24 changes: 18 additions & 6 deletions docs/api/paddle/index_select_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@
index_select
-------------------------------

.. py:function:: paddle.index_select(x, index, axis=0, name=None)
.. py:function:: paddle.index_select(x, index, axis=0, name=None, *, out=None)



沿着指定轴 ``axis`` 对输入 ``x`` 进行索引,取 ``index`` 中指定的相应项,创建并返回到一个新的 Tensor。这里 ``index`` 是一个 ``1-D`` Tensor。除 ``axis`` 轴外,返回的 Tensor 其余维度大小和输入 ``x`` 相等,``axis`` 维度的大小等于 ``index`` 的大小。
沿着指定轴 ``axis`` 对输入 ``x`` 进行索引,取 ``index`` 中指定的相应项,创建并返回到一个新的 Tensor。这里 ``index`` 是一个 ``1-D`` Tensor。除 ``axis`` 轴外,返回的 Tensor 其余维度大小和输入 ``x`` 相等, ``axis`` 维度的大小等于 ``index`` 的大小。

.. note::
别名支持: 参数名 ``input`` 可替代 ``x``, ``dim`` 可替代 ``axis``;
参数顺序支持: 支持 PyTorch 参数顺序 ``(input, dim, index)`` 作为位置参数传入,可转换为 Paddle 顺序 ``(x, index, axis)``;
如 ``(input=x, dim=1, index=idx)`` 等价于 ``(x=x, index=idx, axis=1)``, ``(x, 1, idx)`` 等价于 ``(x, idx, axis=1)``。

参数
:::::::::

- **x** (Tensor)– 输入 Tensor。 ``x`` 的数据类型可以是 float16,float32,float64,int32,int64,complex64,complex128。
- **index** (Tensor)– 包含索引下标的 1-D Tensor。
- **axis** (int,可选) – 索引轴,若未指定,则默认选取第 0 维。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **x** (Tensor) - 输入 Tensor。 ``x`` 的数据类型可以是 float16,float32,float64,int32,int64,complex64,complex128。
别名: ``input``
- **index** (Tensor) - 包含索引下标的 1-D Tensor。
- **axis** (int,可选) - 索引轴,若未指定,则默认选取第 0 维。
别名: ``dim``
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

关键字参数
:::::::::

- **out** (Tensor,可选) - 指定输出结果的 `Tensor`,默认值为 None。

返回
:::::::::
Expand Down
13 changes: 9 additions & 4 deletions docs/api/paddle/logical_and_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ logical_and

.. _Tensor 介绍: ../../guides/beginner/tensor_cn.html#id7

.. note::
别名支持: 参数名 ``input`` 可替代 ``x``, ``other`` 可替代 ``y``。

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

- **x** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **y** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **out** (Tensor,可选)- 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **x** (Tensor) - 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``input``
- **y** (Tensor) - 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``other``
- **out** (Tensor,可选) - 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
Expand Down
10 changes: 7 additions & 3 deletions docs/api/paddle/logical_not_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ logical_not
.. math::
Out = !X

.. note::
别名支持: 参数名 ``input`` 可替代 ``x``。

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

- **x** (Tensor)- 逻辑非运算的输入,是一个 Tensor,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **out** (Tensor,可选)- 指定算子输出结果的 Tensor,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **x** (Tensor) - 逻辑非运算的输入,是一个 Tensor,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``input``
- **out** (Tensor,可选) - 指定算子输出结果的 Tensor,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
Expand Down
11 changes: 8 additions & 3 deletions docs/api/paddle/logical_or_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ logical_or

.. _Tensor 介绍: ../../guides/beginner/tensor_cn.html#id7

.. note::
别名支持: 参数名 ``input`` 可替代 ``x``, ``other`` 可替代 ``y``。

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

- **x** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **x** (Tensor) - 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``input``
- **y** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **out** (Tensor,可选)- 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
别名: ``other``
- **out** (Tensor,可选) - 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
Expand Down
13 changes: 9 additions & 4 deletions docs/api/paddle/logical_xor_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ logical_xor

.. _Tensor 介绍: ../../guides/beginner/tensor_cn.html#id7

.. note::
别名支持: 参数名 ``input`` 可替代 ``x``, ``other`` 可替代 ``y``。

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

- **x** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **y** (Tensor)- 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
- **out** (Tensor,可选)- 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **x** (Tensor) - 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``input``
- **y** (Tensor) - 输入的 `Tensor`,支持的数据类型为 bool, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64, complex128。
别名: ``other``
- **out** (Tensor,可选) - 指定算子输出结果的 `Tensor`,可以是程序中已经创建的任何 Tensor。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
Expand Down