diff --git a/docs/api/paddle/Overview_cn.rst b/docs/api/paddle/Overview_cn.rst index be4c9417701..13f2c3c96eb 100755 --- a/docs/api/paddle/Overview_cn.rst +++ b/docs/api/paddle/Overview_cn.rst @@ -240,6 +240,7 @@ tensor 数学操作原位(inplace)版本 " :ref:`paddle.round_ ` ", "Inplace 版本的 round API,对输入 x 采用 Inplace 策略" " :ref:`paddle.rsqrt_ ` ", "Inplace 版本的 rsqrt API,对输入 x 采用 Inplace 策略" " :ref:`paddle.scale_ ` ", "Inplace 版本的 scale API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.sigmoid_ ` ", "Inplace 版本的 sigmoid API,对输入 x 采用 Inplace 策略" " :ref:`paddle.sqrt_ ` ", "Inplace 版本的 sqrt API,对输入 x 采用 Inplace 策略" " :ref:`paddle.square_ ` ", "Inplace 版本的 square API,对输入 x 采用 Inplace 策略" " :ref:`paddle.sin_ ` ", "Inplace 版本的 sin API,对输入 x 采用 Inplace 策略" @@ -249,8 +250,13 @@ tensor 数学操作原位(inplace)版本 " :ref:`paddle.sub_ ` ", "Inplace 版本的 sub API,对输入 x 采用 Inplace 策略" " :ref:`paddle.tan_ ` ", "Inplace 版本的 tan API,对输入 x 采用 Inplace 策略" " :ref:`paddle.cos_ ` ", "Inplace 版本的 cos API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.cosh_ ` ", "Inplace 版本的 cosh API,对输入 x 采用 Inplace 策略" " :ref:`paddle.atan_ ` ", "Inplace 版本的 atan API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.atanh_ ` ", "Inplace 版本的 atanh API,对输入 x 采用 Inplace 策略" " :ref:`paddle.acos_ ` ", "Inplace 版本的 acos API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.acosh_ ` ", "Inplace 版本的 acosh API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.asin_ ` ", "Inplace 版本的 asin API,对输入 x 采用 Inplace 策略" + " :ref:`paddle.asinh_ ` ", "Inplace 版本的 asinh API,对输入 x 采用 Inplace 策略" " :ref:`paddle.uniform_ ` ", "Inplace 版本的 uniform API,对输入 x 采用 Inplace 策略" " :ref:`paddle.random_ ` ", "Inplace 版本的 random API,对输入 x 采用 Inplace 策略" " :ref:`paddle.lerp_ ` ", "Inplace 版本的 lerp API,对输入 x 采用 Inplace 策略" diff --git a/docs/api/paddle/Tensor__upper_cn.rst b/docs/api/paddle/Tensor__upper_cn.rst index 2e4d1a5080e..1e95052420f 100755 --- a/docs/api/paddle/Tensor__upper_cn.rst +++ b/docs/api/paddle/Tensor__upper_cn.rst @@ -559,6 +559,25 @@ acos(name=None) 请参考 :ref:`cn_api_paddle_acos` +acos_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_acos` API,对输入 ``x`` 采用 Inplace 策略。 + +acosh(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_acosh` + +acosh_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_acosh` API,对输入 ``x`` 采用 Inplace 策略。 + add(y, name=None, \*, alpha=1, out=None) ::::::::: @@ -679,6 +698,25 @@ asin(name=None) 请参考 :ref:`cn_api_paddle_asin` +asin_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_asin` API,对输入 ``x`` 采用 Inplace 策略。 + +asinh(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_asinh` + +asinh_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_asinh` API,对输入 ``x`` 采用 Inplace 策略。 + astype(dtype) ::::::::: @@ -925,6 +963,25 @@ atan(name=None) 请参考 :ref:`cn_api_paddle_atan` +atan_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_atan` API,对输入 ``x`` 采用 Inplace 策略。 + +atanh(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_atanh` + +atanh_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_atanh` API,对输入 ``x`` 采用 Inplace 策略。 + backward(grad_tensor=None, retain_graph=False) ::::::::: @@ -1183,6 +1240,11 @@ cos(name=None) 请参考 :ref:`cn_api_paddle_cos` +cos_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_cos` API,对输入 ``x`` 采用 Inplace 策略。 + cosh(name=None) ::::::::: @@ -1195,6 +1257,11 @@ cosh(name=None) **代码示例** COPY-FROM: paddle.cosh +cosh_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_cosh` API,对输入 ``x`` 采用 Inplace 策略。 + count_nonzero(axis=None, keepdim=False, name=None) ::::::::: @@ -1425,6 +1492,20 @@ exp_(name=None) Inplace 版本的 :ref:`cn_api_paddle_exp` API,对输入 ``x`` 采用 Inplace 策略。 +expm1(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_expm1` + +expm1_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_expm1` API,对输入 ``x`` 采用 Inplace 策略。 + expand(shape, name=None) ::::::::: @@ -2623,6 +2704,21 @@ shard_index(index_num, nshards, shard_id, ignore_value=-1) 请参考 :ref:`cn_api_paddle_shard_index` +sigmoid(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_nn_functional_sigmoid` + +sigmoid_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_nn_functional_sigmoid` API,对输入 ``x`` 采用 Inplace 策略。 + + sign(name=None) ::::::::: @@ -2650,6 +2746,11 @@ sin(name=None) 请参考 :ref:`cn_api_paddle_sin` +sin_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_sin` API,对输入 ``x`` 采用 Inplace 策略。 + sinh(name=None) ::::::::: @@ -2658,6 +2759,11 @@ sinh(name=None) **代码示例** COPY-FROM: paddle.sinh +sinh_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_sinh` API,对输入 ``x`` 采用 Inplace 策略。 + slice(axes, starts, ends) ::::::::: @@ -2772,6 +2878,11 @@ square(name=None) 请参考 :ref:`cn_api_paddle_square` +square_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_square` API,对输入 ``x`` 采用 Inplace 策略。 + squeeze(axis=None, name=None) ::::::::: @@ -2886,6 +2997,20 @@ t(name=None) 请参考 :ref:`cn_api_paddle_t` +tan(name=None) +::::::::: + +返回:计算后的 Tensor + +返回类型:Tensor + +请参考 :ref:`cn_api_paddle_tan` + +tan_(name=None) +::::::::: + +Inplace 版本的 :ref:`cn_api_paddle_tan` API,对输入 ``x`` 采用 Inplace 策略。 + tanh(name=None) ::::::::: @@ -2903,6 +3028,14 @@ Inplace 版本的 :ref:`cn_api_paddle_tan` API,对输入 ``x`` 采用 Inplace tile(repeat_times, name=None) ::::::::: +本方法支持两种调用方式: + +1. **Paddle 风格**: ``x.tile(repeat_times, name=None)`` + 使用张量序列或 Tensor 指定各维度复制次数。 + +2. **PyTorch 风格**: ``x.tile(*dims)`` + 使用可变数量的整数参数指定各维度复制次数。 + 返回:计算后的 Tensor 返回类型:Tensor diff --git a/docs/api/paddle/acos__cn.rst b/docs/api/paddle/acos__cn.rst index 89504c8132d..67b76ce3d31 100644 --- a/docs/api/paddle/acos__cn.rst +++ b/docs/api/paddle/acos__cn.rst @@ -4,7 +4,8 @@ acos\_ ------------------------------- .. py:function:: paddle.acos_(x, name=None) -Inplace 版本的 :ref:`cn_api_paddle_acos` API,对输入 x 采用 Inplace 策略。 + +Inplace 版本的 :ref:`cn_api_paddle_acos` API,对输入 ``x`` 采用 Inplace 策略。 更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 diff --git a/docs/api/paddle/acosh__cn.rst b/docs/api/paddle/acosh__cn.rst new file mode 100644 index 00000000000..5f7f97f0a06 --- /dev/null +++ b/docs/api/paddle/acosh__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_acosh_: + +acosh\_ +------------------------------- + +.. py:function:: paddle.acosh_(x, name=None) + +Inplace 版本的 :ref:`cn_api_paddle_acosh` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/asin__cn.rst b/docs/api/paddle/asin__cn.rst new file mode 100644 index 00000000000..334a9f77423 --- /dev/null +++ b/docs/api/paddle/asin__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_asin_: + +asin\_ +------------------------------- + +.. py:function:: paddle.asin_(x, name=None) + +Inplace 版本的 :ref:`cn_api_paddle_asin` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/asinh__cn.rst b/docs/api/paddle/asinh__cn.rst new file mode 100644 index 00000000000..1300cd1af12 --- /dev/null +++ b/docs/api/paddle/asinh__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_asinh_: + +asinh\_ +------------------------------- + +.. py:function:: paddle.asinh_(x, name=None) + +Inplace 版本的 :ref:`cn_api_paddle_asinh` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/atan__cn.rst b/docs/api/paddle/atan__cn.rst index ae4f28d22f1..57de28af68f 100644 --- a/docs/api/paddle/atan__cn.rst +++ b/docs/api/paddle/atan__cn.rst @@ -4,7 +4,8 @@ atan\_ ------------------------------- .. py:function:: paddle.atan_(x, name=None) -Inplace 版本的 :ref:`cn_api_paddle_atan` API,对输入 x 采用 Inplace 策略。 + +Inplace 版本的 :ref:`cn_api_paddle_atan` API,对输入 ``x`` 采用 Inplace 策略。 更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 diff --git a/docs/api/paddle/atanh__cn.rst b/docs/api/paddle/atanh__cn.rst new file mode 100644 index 00000000000..5d88451ccd0 --- /dev/null +++ b/docs/api/paddle/atanh__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_atanh_: + +atanh\_ +------------------------------- + +.. py:function:: paddle.atanh_(x, name=None) + +Inplace 版本的 :ref:`cn_api_paddle_atanh` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/ceil__cn.rst b/docs/api/paddle/ceil__cn.rst index 4ad3b2240a0..4067588e9e0 100644 --- a/docs/api/paddle/ceil__cn.rst +++ b/docs/api/paddle/ceil__cn.rst @@ -3,9 +3,9 @@ ceil\_ ------------------------------- -.. py:function:: paddle.ceil_(x) +.. py:function:: paddle.ceil_(x, name=None) -Inplace 版本的 :ref:`cn_api_paddle_ceil` API,对输入 x 采用 Inplace 策略。 +Inplace 版本的 :ref:`cn_api_paddle_ceil` API,对输入 ``x`` 采用 Inplace 策略。 更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 diff --git a/docs/api/paddle/cosh__cn.rst b/docs/api/paddle/cosh__cn.rst new file mode 100644 index 00000000000..502012cd4fa --- /dev/null +++ b/docs/api/paddle/cosh__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_cosh_: + +cosh\_ +------------------------------- + +.. py:function:: paddle.cosh_(x, name=None) + +Inplace 版本的 :ref:`cn_api_paddle_cosh` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/expm1__cn.rst b/docs/api/paddle/expm1__cn.rst index ac168670222..c33d1b873f5 100644 --- a/docs/api/paddle/expm1__cn.rst +++ b/docs/api/paddle/expm1__cn.rst @@ -4,7 +4,8 @@ expm1\_ ------------------------------- .. py:function:: paddle.expm1_(x, name=None) -Inplace 版本的 :ref:`cn_api_paddle_expm1` API,对输入 x 采用 Inplace 策略。 + +Inplace 版本的 :ref:`cn_api_paddle_expm1` API,对输入 ``x`` 采用 Inplace 策略。 更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 diff --git a/docs/api/paddle/floor__cn.rst b/docs/api/paddle/floor__cn.rst index 6ebc3ff914f..56149e60c23 100644 --- a/docs/api/paddle/floor__cn.rst +++ b/docs/api/paddle/floor__cn.rst @@ -3,7 +3,7 @@ floor\_ ------------------------------- -.. py:function:: paddle.floor_(name=None) +.. py:function:: paddle.floor_(x, name=None) Inplace 版本的 :ref:`cn_api_paddle_floor` API,对输入 ``x`` 采用 Inplace 策略。 diff --git a/docs/api/paddle/reciprocal__cn.rst b/docs/api/paddle/reciprocal__cn.rst index 84dd9b5cd67..e7a98128176 100644 --- a/docs/api/paddle/reciprocal__cn.rst +++ b/docs/api/paddle/reciprocal__cn.rst @@ -3,7 +3,7 @@ reciprocal\_ ------------------------------- -.. py:function:: paddle.reciprocal_(name=None) +.. py:function:: paddle.reciprocal_(x, name=None) Inplace 版本的 :ref:`cn_api_paddle_reciprocal` API,对输入 ``x`` 采用 Inplace 策略。 diff --git a/docs/api/paddle/sigmoid__cn.rst b/docs/api/paddle/sigmoid__cn.rst new file mode 100644 index 00000000000..28bc69f5584 --- /dev/null +++ b/docs/api/paddle/sigmoid__cn.rst @@ -0,0 +1,12 @@ +.. _cn_api_paddle_sigmoid_: + +sigmoid\_ +------------------------------- + +.. py:function:: paddle.sigmoid_(x, name=None) + +Inplace 版本的 :ref:`paddle.nn.functional.sigmoid ` API,对输入 ``x`` 采用 Inplace 策略。 + +更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 + +.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3 diff --git a/docs/api/paddle/sinh__cn.rst b/docs/api/paddle/sinh__cn.rst index 5cf1f98e762..287a959e2a1 100644 --- a/docs/api/paddle/sinh__cn.rst +++ b/docs/api/paddle/sinh__cn.rst @@ -3,7 +3,7 @@ sinh\_ ------------------------------- -.. py:function:: paddle.sinh_(x, name=None, *, out=None) +.. py:function:: paddle.sinh_(x, name=None) Inplace 版本的 :ref:`cn_api_paddle_sinh` API,对输入 ``x`` 采用 Inplace 策略。 diff --git a/docs/api/paddle/square__cn.rst b/docs/api/paddle/square__cn.rst index 67968bdb0b7..61862702740 100644 --- a/docs/api/paddle/square__cn.rst +++ b/docs/api/paddle/square__cn.rst @@ -4,7 +4,8 @@ square\_ ------------------------------- .. py:function:: paddle.square_(x, name=None) -Inplace 版本的 :ref:`cn_api_paddle_square` API,对输入 x 采用 Inplace 策略。 + +Inplace 版本的 :ref:`cn_api_paddle_square` API,对输入 ``x`` 采用 Inplace 策略。 更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。 diff --git a/docs/api/paddle/tile_cn.rst b/docs/api/paddle/tile_cn.rst index 860f51b0326..ea2d776c906 100644 --- a/docs/api/paddle/tile_cn.rst +++ b/docs/api/paddle/tile_cn.rst @@ -5,19 +5,27 @@ tile .. py:function:: paddle.tile(x, repeat_times, name=None) +本 API 支持两种调用方式: + +1. **Paddle 风格**: ``paddle.tile(x, repeat_times, name=None)`` + 根据参数 ``repeat_times`` 对输入 ``x`` 的各维度进行复制。 + +2. **PyTorch 风格**: ``paddle.tile(input, *dims)`` + 使用可变数量的整数参数指定复制次数。Tensor 方法中也可写作 ``x.tile(*dims)``。 + 根据参数 ``repeat_times`` 对输入 ``x`` 的各维度进行复制。平铺后,输出的第 ``i`` 个维度的值等于 ``x.shape[i]*repeat_times[i]`` 。 ``x`` 的维数和 ``repeat_times`` 中的元素数量应小于等于 6。 参数 ::::::::: - - **x** (Tensor) - 输入的 Tensor,数据类型为:bool、float16、float32、float64、int32 或 int64。 - - **repeat_times** (list|tuple|Tensor) - 指定输入 ``x`` 每个维度的复制次数。如果 ``repeat_times`` 的类型是 list 或 tuple,它的元素可以是整数或者数据类型为 int32 的 1-D Tensor。如果 ``repeat_times`` 的类型是 Tensor,则是数据类型为 int32 的 1-D Tensor。 + - **x** (Tensor) - 输入的 Tensor,数据类型为:bool、float16、float32、float64、int32、int64、complex64 或 complex128。别名 ``input``。 + - **repeat_times** (list|tuple|Tensor) - 指定输入 ``x`` 每个维度的复制次数。如果 ``repeat_times`` 的类型是 list 或 tuple,它的元素可以是整数或者数据类型为 int32 的 1-D Tensor。如果 ``repeat_times`` 的类型是 Tensor,则是数据类型为 int32 的 1-D Tensor。别名 ``dims``。 - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 返回 ::::::::: -``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x[i] * repeat_times[i]`` 。 +``Tensor``,数据类型与 ``x`` 相同。返回值的第 i 维的大小等于 ``x.shape[i] * repeat_times[i]`` 。 代码示例 :::::::::