-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
【doc】Add divide, floor_divide, remainder doc (#2437)
- Loading branch information
1 parent
d068604
commit 9cfbc97
Showing
13 changed files
with
207 additions
and
162 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` | ||
!DO NOT EDIT THIS FILE MANUALLY! | ||
.. _api_tensor_math_divide: | ||
|
||
divide | ||
------ | ||
|
||
.. autofunction:: paddle.tensor.math.divide | ||
:noindex: | ||
|
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,11 @@ | ||
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` | ||
!DO NOT EDIT THIS FILE MANUALLY! | ||
.. _api_tensor_math_floor_divide: | ||
|
||
floor_divide | ||
------------ | ||
|
||
.. autofunction:: paddle.tensor.math.floor_divide | ||
:noindex: | ||
|
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,11 @@ | ||
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` | ||
!DO NOT EDIT THIS FILE MANUALLY! | ||
.. _api_tensor_math_floor_mod: | ||
|
||
floor_mod | ||
--------- | ||
|
||
.. autofunction:: paddle.tensor.math.floor_mod | ||
:noindex: | ||
|
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,11 @@ | ||
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` | ||
!DO NOT EDIT THIS FILE MANUALLY! | ||
.. _api_tensor_math_mod: | ||
|
||
mod | ||
--- | ||
|
||
.. autofunction:: paddle.tensor.math.mod | ||
:noindex: | ||
|
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,11 @@ | ||
.. THIS FILE IS GENERATED BY `gen_doc.{py|sh}` | ||
!DO NOT EDIT THIS FILE MANUALLY! | ||
.. _api_tensor_math_remainder: | ||
|
||
remainder | ||
--------- | ||
|
||
.. autofunction:: paddle.tensor.math.remainder | ||
:noindex: | ||
|
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 was deleted.
Oops, something went wrong.
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,43 @@ | ||
.. _cn_api_tensor_divide: | ||
|
||
divide | ||
------------------------------- | ||
|
||
.. py:function:: paddle.divide(x, y, name=None) | ||
该OP是逐元素相除算子,输入 ``x`` 与输入 ``y`` 逐元素相除,并将各个位置的输出元素保存到返回结果中。 | ||
输入 ``x`` 与输入 ``y`` 必须可以广播为相同形状, 关于广播规则,请参考 :ref:`use_guide_broadcasting` | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X / Y | ||
- :math:`X` :多维Tensor。 | ||
- :math:`Y` :多维Tensor。 | ||
|
||
参数: | ||
- x(Tensor)- 多维Tensor。数据类型为float32 、float64、int32或int64。 | ||
- y(Tensor)- 多维Tensor。数据类型为float32 、float64、int32或int64。 | ||
- name(str,可选)- 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
|
||
返回: 多维 Tensor, 数据类型与 ``x`` 相同,维度为广播后的形状。 | ||
|
||
返回类型: Tensor | ||
|
||
|
||
**代码示例** | ||
|
||
.. code-block:: python | ||
import paddle | ||
import numpy as np | ||
paddle.disable_static() | ||
np_x = np.array([2, 3, 4]).astype('float64') | ||
np_y = np.array([1, 5, 2]).astype('float64') | ||
x = paddle.to_tensor(np_x) | ||
y = paddle.to_tensor(np_y) | ||
z = paddle.divide(x, y) | ||
print(z.numpy()) # [2., 0.6, 2.] |
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,43 @@ | ||
.. _cn_api_tensor_floor_divide: | ||
|
||
floor_divide | ||
------------------------------- | ||
|
||
.. py:function:: paddle.floor_divide(x, y, name=None) | ||
该OP是逐元素整除算子,输入 ``x`` 与输入 ``y`` 逐元素整除,并将各个位置的输出元素保存到返回结果中。 | ||
输入 ``x`` 与输入 ``y`` 必须可以广播为相同形状, 关于广播规则,请参考 :ref:`use_guide_broadcasting` | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X // Y | ||
- :math:`X` :多维Tensor。 | ||
- :math:`Y` :多维Tensor。 | ||
|
||
参数: | ||
- x(Tensor)- 多维Tensor。数据类型为int32或int64。 | ||
- y(Tensor)- 多维Tensor。数据类型为int32或int64。 | ||
- name(str,可选)- 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
|
||
返回: 多维 Tensor, 数据类型与 ``x`` 相同,维度为广播后的形状。 | ||
|
||
返回类型: Tensor | ||
|
||
|
||
**代码示例** | ||
|
||
.. code-block:: python | ||
import paddle | ||
import numpy as np | ||
paddle.disable_static() | ||
np_x = np.array([2, 3, 8, 7]) | ||
np_y = np.array([1, 5, 3, 3]) | ||
x = paddle.to_tensor(np_x) | ||
y = paddle.to_tensor(np_y) | ||
z = paddle.floor_divide(x, y) | ||
print(z.numpy()) # [2, 0, 2, 2] |
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,7 @@ | ||
.. _cn_api_tensor_cn_floor_mod: | ||
|
||
floor_mod | ||
------------------------------- | ||
:doc_source: paddle.tensor.remainder | ||
|
||
|
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,7 @@ | ||
.. _cn_api_tensor_cn_mod: | ||
|
||
mod | ||
------------------------------- | ||
:doc_source: paddle.tensor.remainder | ||
|
||
|
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,42 @@ | ||
.. _cn_api_tensor_remainder: | ||
|
||
remainder | ||
------------------------------- | ||
|
||
.. py:function:: paddle.remainder(x, y, name=None) | ||
该OP是逐元素取模算子,输入 ``x`` 与输入 ``y`` 逐元素取模,并将各个位置的输出元素保存到返回结果中。 | ||
输入 ``x`` 与输入 ``y`` 必须可以广播为相同形状, 关于广播规则,请参考 :ref:`use_guide_broadcasting` | ||
|
||
等式为: | ||
|
||
.. math:: | ||
Out = X \% Y | ||
- :math:`X` :多维Tensor。 | ||
- :math:`Y` :多维Tensor。 | ||
|
||
参数: | ||
- x(Tensor)- 多维Tensor。数据类型为float32 、float64、int32或int64。 | ||
- y(Tensor)- 多维Tensor。数据类型为float32 、float64、int32或int64。 | ||
- name(str,可选)- 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name`。 | ||
|
||
|
||
返回: 多维 Tensor, 数据类型与 ``x`` 相同,维度为广播后的形状。 | ||
|
||
返回类型: Tensor | ||
|
||
|
||
**代码示例** | ||
|
||
.. code-block:: python | ||
import paddle | ||
import numpy as np | ||
paddle.disable_static() | ||
np_x = np.array([2, 3, 8, 7]) | ||
np_y = np.array([1, 5, 3, 3]) | ||
x = paddle.to_tensor(np_x) | ||
y = paddle.to_tensor(np_y) | ||
z = paddle.remainder(x, y) | ||
print(z.numpy()) # [0, 3, 2, 1] |