-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Update paddle.clamp
#25906
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
Update paddle.clamp
#25906
Conversation
Thanks for your contribution! |
7f1cfd2
to
665e771
Compare
a1ea928
to
c4a66ff
Compare
python/paddle/tensor/math.py
Outdated
a resulting tensor as the following equation: | ||
|
||
.. math:: | ||
|
||
Out = MIN(MAX(x, min), max) | ||
|
||
Args: | ||
input (Variable): An input N-D Tensor or LoDTensor | ||
with data type float32, float64. | ||
x (Tensor): An N-D Tensor with data type float32 or float64. | ||
min (float32|Variable): The lower bound with type ``float32`` or a ``Tensor`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable -> Tensor here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, done, thanks!
46f86a9
to
955123d
Compare
:alias_main: paddle.clamp | ||
:alias: paddle.clamp,paddle.tensor.clamp,paddle.tensor.math.clamp | ||
:alias_main: paddle.clip | ||
:alias: paddle.clip,paddle.tensor.clip,paddle.tensor.math.clip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两行写在docstring里的alias标签是可以去掉的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tensor.clamp倍tensor.clip替换,删除相关单测
77269e0
to
1aa2436
Compare
fa389fa
to
28daf5f
Compare
rename to `paddle.clip` add fast path for dygraph mode remove `out` rename `input` -> `x` update doc sample
also trigger CI
fb1eb36
to
1d4272e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1d4272e
to
4cd06c5
Compare
2579542
to
2a59b0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Breaking changes
PR changes
APIs
Describe
rename to
paddle.clip
add fast path for dygraph mode
remove
out
rename
input
->x
update doc sample
also fix
cosine_similarity
conflict