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

【Hackathon 5th No.3】为 Paddle 新增 masked_fill API #57355

Merged
merged 34 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4925ae4
add masked_fill for paddle
AndSonder Sep 15, 2023
fbec78a
update doc
AndSonder Sep 15, 2023
3cfde41
update some test case
AndSonder Sep 15, 2023
37dd891
remove full_like
AndSonder Sep 15, 2023
793fcdc
update test codes
AndSonder Sep 15, 2023
0c1e8ce
update test cases
AndSonder Sep 16, 2023
faa459a
recover codes
AndSonder Sep 16, 2023
0a4d8d4
update test codes
AndSonder Sep 19, 2023
746a818
fix gradients error
AndSonder Sep 20, 2023
d48d73d
update test codes
AndSonder Sep 20, 2023
7a0ef26
fix
AndSonder Sep 21, 2023
de8cd75
add bf16 test cases
AndSonder Sep 21, 2023
fb1a2ea
update code-block
AndSonder Sep 25, 2023
810575f
Merge branch 'masked_fill' of https://github.com/AndSonder/Paddle int…
AndSonder Sep 25, 2023
1b213bf
Merge branch 'develop' into masked_fill
AndSonder Sep 25, 2023
df6013e
update code-block
AndSonder Sep 25, 2023
82bb307
Merge branch 'masked_fill' of https://github.com/AndSonder/Paddle int…
AndSonder Sep 25, 2023
1349206
update test codes
AndSonder Sep 26, 2023
9ef08e4
Merge branch 'develop' into masked_fill
AndSonder Oct 3, 2023
5f463ad
Update __init__.py
AndSonder Oct 3, 2023
fe74eff
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
AndSonder Oct 3, 2023
4d394a0
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
AndSonder Oct 3, 2023
211d655
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
AndSonder Oct 8, 2023
0703cd0
fix
AndSonder Oct 8, 2023
1c0abb8
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
AndSonder Oct 11, 2023
f9bdfa0
fix code style and recover third_party
AndSonder Oct 11, 2023
f5db8f6
add v grad check
AndSonder Oct 11, 2023
0f48c13
add scalar value case
AndSonder Oct 11, 2023
c8040ce
fix test case
AndSonder Oct 12, 2023
ccb535c
use logical_not
AndSonder Oct 18, 2023
2317773
Merge branch 'develop' into masked_fill
AndSonder Oct 18, 2023
f678e39
fix doc style
AndSonder Oct 20, 2023
d6b7bd7
Update manipulation.py
AndSonder Oct 23, 2023
bccd1f6
Merge branch 'develop' into masked_fill
AndSonder Oct 24, 2023
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
Prev Previous commit
Next Next commit
fix doc style
  • Loading branch information
AndSonder authored Oct 20, 2023
commit f678e395fcdd158e4ab10394f6699e6cc005ff44
6 changes: 4 additions & 2 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4567,11 +4567,11 @@ def masked_fill(x, mask, value, name=None):

Args:
x (Tensor) : The Destination Tensor. Supported data types are float,
double, int, int64_t,float16 and bfloat16.
double, int, int64_t,float16 and bfloat16.
mask (Tensor): The boolean tensor indicate the position to be filled.
The data type of mask must be bool.
value (Scalar or 0-D Tensor): The value used to fill the target tensor.
Supported data types are float, double, int, int64_t,float16 and bfloat16.
Supported data types are float, double, int, int64_t,float16 and bfloat16.
name(str, optional): The default value is None. Normally there is no
need for user to set this property. For more information, please
refer to :ref:`api_guide_Name`.
Copy link
Contributor

Choose a reason for hiding this comment

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

参数说明中写明支持的dtype,且要和设计文档中的一致; Scaler -> Scalar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Expand All @@ -4580,6 +4580,7 @@ def masked_fill(x, mask, value, name=None):
Tensor, same dimention and dtype with x.
Examples:
.. code-block:: python

>>> # doctest: +REQUIRES(env:GPU)
>>> import paddle
>>> x = paddle.ones((3, 3), dtype="float32")
Expand Down Expand Up @@ -4610,6 +4611,7 @@ def masked_fill_(x, mask, value, name=None):

Examples:
.. code-block:: python

>>> # doctest: +REQUIRES(env:GPU)
>>> import paddle
>>> x = paddle.ones((3, 3), dtype="float32")
Expand Down