Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix boardcasting superlink #48434

Merged
merged 22 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion paddle/fluid/operators/controlflow/bitwise_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ It operates ``%s`` on Tensor ``X`` and ``Y`` .
%s

.. note::
``paddle.%s`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.%s`` supports broadcasting. If you want know more about broadcasting, please refer to please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job!
我在检查文档的过程中发现paddle.bitwise_not在文档中遗漏了broadcasting的说明,辛苦加上~

)DOC",
comment.type,
comment.equation,
Expand Down
7 changes: 6 additions & 1 deletion python/paddle/distribution/uniform.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ class Uniform(distribution.Distribution):
* :math:`Z`: is the normalizing constant.

The parameters `low` and `high` must be shaped in a way that supports
:ref:`user_guide_broadcasting` (e.g., `high - low` is a valid operation).
Boardcasting` (e.g., `high - low` is a valid operation).
enkilee marked this conversation as resolved.
Show resolved Hide resolved

Note:
If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
low(int|float|list|tuple|numpy.ndarray|Tensor): The lower boundary of
Expand Down
6 changes: 4 additions & 2 deletions python/paddle/tensor/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2005,8 +2005,10 @@ def complex(real, imag, name=None):
Returns:
Tensor: The output tensor. The data type is 'complex64' or 'complex128', with the same precision as ``real`` and ``imag``.

**Note**:
``paddle.complex`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
Note:
``paddle.complex`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Examples:
.. code-block:: python
Expand Down
12 changes: 9 additions & 3 deletions python/paddle/tensor/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def logical_and(x, y, out=None, name=None):
out = x \&\& y

Note:
``paddle.logical_and`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.logical_and`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
Expand Down Expand Up @@ -136,7 +138,9 @@ def logical_or(x, y, out=None, name=None):
out = x || y

Note:
``paddle.logical_or`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.logical_or`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
Expand Down Expand Up @@ -178,7 +182,9 @@ def logical_xor(x, y, out=None, name=None):
out = (x || y) \&\& !(x \&\& y)

Note:
``paddle.logical_xor`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.logical_xor`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be one of bool, int8, int16, in32, in64, float32, float64.
Expand Down
51 changes: 39 additions & 12 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ def pow(x, y, name=None):
out = x^{y}

Note:
``paddle.pow`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.pow`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensors


Args:
Expand Down Expand Up @@ -679,7 +681,9 @@ def subtract(x, y, name=None):
out = x - y

Note:
``paddle.subtract`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.subtract`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
Expand Down Expand Up @@ -773,7 +777,9 @@ def divide(x, y, name=None):
out = x / y

Note:
``paddle.divide`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.divide`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
Expand Down Expand Up @@ -817,7 +823,9 @@ def floor_divide(x, y, name=None):
out = trunc(x / y)

Note:
``paddle.floor_divide`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.floor_divide`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor
Also note that the name ``floor_divide`` can be misleading, as the quotinents are actually rounded toward zero, not toward negative infinite.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

出现了一个报错,需要在链接和 Also note that 之间加个空行


Args:
Expand Down Expand Up @@ -859,7 +867,9 @@ def remainder(x, y, name=None):
out = x \% y

Note:
``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.remainder`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
Expand Down Expand Up @@ -924,7 +934,9 @@ def multiply(x, y, name=None):
out = x * y

Note:
``paddle.multiply`` supports broadcasting. If you would like to know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.multiply`` supports broadcasting. If you would like to know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, its data type should be one of float32, float64, int32, int64, bool.
Expand Down Expand Up @@ -980,7 +992,9 @@ def maximum(x, y, name=None):
out = max(x, y)

Note:
``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
Expand Down Expand Up @@ -1046,7 +1060,9 @@ def minimum(x, y, name=None):
out = min(x, y)

Note:
``paddle.minimum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.minimum`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float32, float64, int32, int64.
Expand Down Expand Up @@ -1114,7 +1130,9 @@ def fmax(x, y, name=None):
out = fmax(x, y)

Note:
``paddle.fmax`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.fmax`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
Expand Down Expand Up @@ -1182,7 +1200,9 @@ def fmin(x, y, name=None):
out = fmin(x, y)

Note:
``paddle.fmin`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` .
``paddle.fmin`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): the input tensor, it's data type should be float16, float32, float64, int32, int64.
Expand Down Expand Up @@ -3962,7 +3982,12 @@ def any(x, axis=None, keepdim=False, name=None):

def broadcast_shape(x_shape, y_shape):
"""
The function returns the shape of doing operation with broadcasting on tensors of x_shape and y_shape, please refer to :ref:`user_guide_broadcasting` for more details.
The function returns the shape of doing operation with broadcasting on tensors of x_shape and y_shape, please refer to boardcasting for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refer to boardcasting for more details. 和下文的note重复了,删掉吧


Note:
If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x_shape (list[int]|tuple[int]): A shape of tensor.
Expand Down Expand Up @@ -4991,7 +5016,9 @@ def heaviside(x, y, name=None):
\right.

Note:
``paddle.heaviside`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting`.
``paddle.heaviside`` supports broadcasting. If you want know more about broadcasting, please refer to `Introduction to Tensor`_ .

.. _Introduction to Tensor: ../../guides/beginner/tensor_en.html#chapter5-broadcasting-of-tensor

Args:
x (Tensor): The input tensor of Heaviside step function, it's data type should be float16, float32, float64, int32 or int64.
Expand Down