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

修改了英文API文档 #48219

Merged
merged 33 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
689898b
修改paddle.nn.dynamic_decode,paddle.nn.functional.diag_embed 示例
Atlantisming Nov 20, 2022
ef533c5
Merge branch 'PaddlePaddle:develop' into develop
Atlantisming Nov 21, 2022
1fee067
Merge branch 'PaddlePaddle:develop' into develop
Atlantisming Nov 21, 2022
e9dff97
Merge branch 'PaddlePaddle:develop' into develop
Atlantisming Nov 21, 2022
20071df
mma qk tensor_core (#48087)
carryyu Nov 21, 2022
2a0d07d
remove lrn which is not used in paddle 2.0 (#47945)
Vvsmile Nov 21, 2022
b8c14a7
replace scatter_nd and scatter_nd_add with paddle.scatter_nd and (#47…
Vvsmile Nov 21, 2022
6450a74
[PHI] Migrate mul_grad kernel (#48061)
Silv3S Nov 21, 2022
1698673
delete unnecessary shape and slice op (#48112)
RichardWooSJTU Nov 21, 2022
1c35c3a
Merge remote-tracking branch 'origin/develop' into my-branch
Atlantisming Nov 21, 2022
ccc5a5a
修改英文文档。
Atlantisming Nov 21, 2022
fc04ce6
Merge branch 'PaddlePaddle:develop' into develop
Atlantisming Nov 21, 2022
9336899
Merge branch 'develop' into my-branch
Atlantisming Nov 22, 2022
8f71143
修改segment operator等英文文档。
Atlantisming Nov 22, 2022
8f6b836
重新修改了paddle.einsum,paddle.unique_consecutive,
Atlantisming Nov 23, 2022
9619c78
重新修改了英文文档格式。;test=docs_preview
Atlantisming Nov 25, 2022
597cf5d
Update extension.py
Ligoml Nov 29, 2022
d1afde5
重新修改了英文文档格式。;test=docs_preview
Atlantisming Dec 1, 2022
74815e4
重新修改了英文文档格式。
Atlantisming Dec 2, 2022
235adca
Merge branch 'PaddlePaddle:develop' into my-branch
Atlantisming Dec 3, 2022
8068466
重新修改了英文文档格式。
Atlantisming Dec 3, 2022
b1d60fe
重新修改了英文文档格式。
Atlantisming Dec 3, 2022
d7ef701
update
SigureMo Dec 3, 2022
cbe7a05
test=docs_preview
SigureMo Dec 3, 2022
3426ec6
update formula; test=docs_preview
SigureMo Dec 3, 2022
fdd30e9
update formula; test=docs_preview
SigureMo Dec 3, 2022
a62cd0f
remove this operator; test=docs_preview
SigureMo Dec 3, 2022
017a45e
add hyper link; test=docs_preview
SigureMo Dec 3, 2022
c5a40e4
add default value; test=docs_preview
SigureMo Dec 3, 2022
9341553
update format; test=docs_preview
SigureMo Dec 3, 2022
d734777
empty commit; test=docs_preview
SigureMo Dec 3, 2022
fba0e71
fix codestyle issues; test=docs_preview
SigureMo Dec 3, 2022
1d5b5b2
empty commit; test=docs_preview
SigureMo Dec 3, 2022
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: 2 additions & 2 deletions python/paddle/device/cuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ def _set_current_stream(stream):
@signature_safe_contextmanager
def stream_guard(stream):
'''
**Notes**:
**This API only supports dygraph mode currently.**
Notes:
This API only supports dygraph mode currently.
Ligoml marked this conversation as resolved.
Show resolved Hide resolved
SigureMo marked this conversation as resolved.
Show resolved Hide resolved

A context manager that specifies the current stream context by the given stream.

Expand Down
3 changes: 2 additions & 1 deletion python/paddle/fluid/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,8 @@ def disable_signal_handler():

Make sure you called paddle.disable_signal_handler() before using above mentioned frameworks.

Returns: None
Returns:
None

Examples:
.. code-block:: python
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/layers/rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,6 @@ def dynamic_decode(

SigureMo marked this conversation as resolved.
Show resolved Hide resolved
.. code-block:: python

import numpy as np
import paddle
from paddle.nn import BeamSearchDecoder, dynamic_decode
from paddle.nn import GRUCell, Linear, Embedding
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/framework/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def set_grad_enabled(mode):
Args:
mode(bool): whether to enable (`True`), or disable (`False`) grad.

Returns:
None.

Examples:
.. code-block:: python

Expand Down
16 changes: 8 additions & 8 deletions python/paddle/incubate/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
reason="paddle.incubate.segment_sum will be removed in future",
)
def segment_sum(data, segment_ids, name=None):
r"""
"""
SigureMo marked this conversation as resolved.
Show resolved Hide resolved
Segment Sum Operator.

This operator sums the elements of input `data` which with
Expand All @@ -45,7 +45,7 @@ def segment_sum(data, segment_ids, name=None):
For more information, please refer to :ref:`api_guide_Name`.

Returns:
output (Tensor): the reduced result.
Tensor: the reduced result.
Atlantisming marked this conversation as resolved.
Show resolved Hide resolved

Examples:

Expand Down Expand Up @@ -92,7 +92,7 @@ def segment_sum(data, segment_ids, name=None):
reason="paddle.incubate.segment_mean will be removed in future",
)
def segment_mean(data, segment_ids, name=None):
r"""
"""
Segment mean Operator.

Ihis operator calculate the mean value of input `data` which
Expand All @@ -110,7 +110,7 @@ def segment_mean(data, segment_ids, name=None):
For more information, please refer to :ref:`api_guide_Name`.

Returns:
output (Tensor): the reduced result.
Tensor: the reduced result.

Examples:

Expand Down Expand Up @@ -158,7 +158,7 @@ def segment_mean(data, segment_ids, name=None):
reason="paddle.incubate.segment_min will be removed in future",
)
def segment_min(data, segment_ids, name=None):
r"""
"""
Segment min operator.

This operator calculate the minimum elements of input `data` which with
Expand All @@ -175,7 +175,7 @@ def segment_min(data, segment_ids, name=None):
For more information, please refer to :ref:`api_guide_Name`.

Returns:
output (Tensor): the reduced result.
Tensor: the reduced result.

Examples:

Expand Down Expand Up @@ -224,7 +224,7 @@ def segment_min(data, segment_ids, name=None):
reason="paddle.incubate.segment_max will be removed in future",
)
def segment_max(data, segment_ids, name=None):
r"""
"""
Segment max operator.

This operator calculate the maximum elements of input `data` which with
Expand All @@ -241,7 +241,7 @@ def segment_max(data, segment_ids, name=None):
For more information, please refer to :ref:`api_guide_Name`.

Returns:
output (Tensor): the reduced result.
Tensor: the reduced result.

Examples:

Expand Down
82 changes: 41 additions & 41 deletions python/paddle/nn/functional/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,48 +57,48 @@ def diag_embed(input, offset=0, dim1=-2, dim2=-1):
Examples:
SigureMo marked this conversation as resolved.
Show resolved Hide resolved
.. code-block:: python

import paddle
import paddle.nn.functional as F
import numpy as np

diag_embed = np.random.randn(2, 3).astype('float32')
# [[ 0.7545889 , -0.25074545, 0.5929117 ],
# [-0.6097662 , -0.01753256, 0.619769 ]]

data1 = F.diag_embed(diag_embed)
data1.numpy()
# [[[ 0.7545889 , 0. , 0. ],
# [ 0. , -0.25074545, 0. ],
# [ 0. , 0. , 0.5929117 ]],

# [[-0.6097662 , 0. , 0. ],
# [ 0. , -0.01753256, 0. ],
# [ 0. , 0. , 0.619769 ]]]

data2 = F.diag_embed(diag_embed, offset=-1, dim1=0, dim2=2)
data2.numpy()
# [[[ 0. , 0. , 0. , 0. ],
# [ 0.7545889 , 0. , 0. , 0. ],
# [ 0. , -0.25074545, 0. , 0. ],
# [ 0. , 0. , 0.5929117 , 0. ]],
#
# [[ 0. , 0. , 0. , 0. ],
# [-0.6097662 , 0. , 0. , 0. ],
# [ 0. , -0.01753256, 0. , 0. ],
# [ 0. , 0. , 0.619769 , 0. ]]]

data3 = F.diag_embed(diag_embed, offset=1, dim1=0, dim2=2)
data3.numpy()
# [[[ 0. , 0.7545889 , 0. , 0. ],
# [ 0. , -0.6097662 , 0. , 0. ]],
#
# [[ 0. , 0. , -0.25074545, 0. ],
# [ 0. , 0. , -0.01753256, 0. ]],
#
# [[ 0. , 0. , 0. , 0.5929117 ],
# [ 0. , 0. , 0. , 0.619769 ]],
#
# [[ 0. , 0. , 0. , 0. ],
# [ 0. , 0. , 0. , 0. ]]]

diag_embed_input = paddle.arange(6)

diag_embed_output1 = F.diag_embed(diag_embed_input)
print(diag_embed_output1)
# Tensor(shape=[6, 6], dtype=int64, place=Place(cpu), stop_gradient=True,
# [[0, 0, 0, 0, 0, 0],
# [0, 1, 0, 0, 0, 0],
# [0, 0, 2, 0, 0, 0],
# [0, 0, 0, 3, 0, 0],
# [0, 0, 0, 0, 4, 0],
# [0, 0, 0, 0, 0, 5]])

diag_embed_output2 = F.diag_embed(diag_embed_input, offset=-1, dim1=0,dim2=1 )
print(diag_embed_output2)
# Tensor(shape=[7, 7], dtype=int64, place=Place(cpu), stop_gradient=True,
# [[0, 0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0, 0],
# [0, 1, 0, 0, 0, 0, 0],
# [0, 0, 2, 0, 0, 0, 0],
# [0, 0, 0, 3, 0, 0, 0],
# [0, 0, 0, 0, 4, 0, 0],
# [0, 0, 0, 0, 0, 5, 0]])

diag_embed_input_2dim = paddle.reshape(diag_embed_input,[2,3])
print(diag_embed_input_2dim)
# Tensor(shape=[2, 3], dtype=int64, place=Place(cpu), stop_gradient=True,
# [[0, 1, 2],
# [3, 4, 5]])
diag_embed_output3 = F.diag_embed(diag_embed_input_2dim,offset= 0, dim1=0, dim2=2 )
print(diag_embed_output3)
# Tensor(shape=[3, 2, 3], dtype=int64, place=Place(cpu), stop_gradient=True,
# [[[0, 0, 0],
# [3, 0, 0]],

# [[0, 1, 0],
# [0, 4, 0]],

# [[0, 0, 2],
# [0, 0, 5]]])
"""
if not isinstance(input, Variable):
input = assign(input)
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/einsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def gen_einsum_op(equation, *operands):


def einsum(equation, *operands):
r"""
"""

einsum(equation, *operands)

Expand Down
4 changes: 2 additions & 2 deletions python/paddle/tensor/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ def slogdet(x, name=None):


def svd(x, full_matrices=False, name=None):
r"""
"""
Computes the singular value decomposition of one matrix or a batch of regular matrices.

Let :math:`X` be the input matrix or a batch of input matrices, the output should satisfies:
Expand All @@ -2047,7 +2047,7 @@ def svd(x, full_matrices=False, name=None):
For more information, please refer to :ref:`api_guide_Name`.
Ligoml marked this conversation as resolved.
Show resolved Hide resolved

Returns:
Tuple of 3 tensors: (U, S, VH). VH is the conjugate transpose of V. S is the singlar value vectors of matrics with shape `[..., K]`
Tuple of 3 tensors(U, S, VH): VH is the conjugate transpose of V. S is the singlar value vectors of matrics with shape `[..., K]`
SigureMo marked this conversation as resolved.
Show resolved Hide resolved

Examples:
.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ def unique_consecutive(
dtype="int64",
name=None,
):
r"""
"""
Eliminates all but the first element from every consecutive group of equivalent elements.

Note:
Expand All @@ -2296,7 +2296,7 @@ def unique_consecutive(
:ref:`api_guide_Name`. Default is None.

Returns:
tuple (out, inverse, counts). `out` is the unique consecutive tensor for `x`. `inverse` is provided only if `return_inverse` is True. `counts` is provided only if `return_counts` is True.
tuple(out, inverse, counts): `out` is the unique consecutive tensor for `x`. `inverse` is provided only if `return_inverse` is True. `counts` is provided only if `return_counts` is True.
SigureMo marked this conversation as resolved.
Show resolved Hide resolved

Example:
.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -3437,7 +3437,7 @@ def cumprod(x, dim=None, dtype=None, name=None):
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

Returns:
Tensor, the result of cumprod operator.
Tensor: the result of cumprod operator.
Ligoml marked this conversation as resolved.
Show resolved Hide resolved

Examples:
.. code-block:: python
Expand Down