-
Notifications
You must be signed in to change notification settings - Fork 5.7k
renorm op #38130
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
renorm op #38130
Conversation
Thanks for your contribution! |
paddle/fluid/operators/renorm_op.cu
Outdated
TensorReduceFunctorImpl<T, T, CustomSum>(pow_value, &dim_value, reduce_axis, | ||
stream); | ||
TensorReduceFunctorImpl<T, T, CustomSum>(mul_value, &weight_derivative, | ||
reduce_axis, stream); |
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.
Recently, this PR add the transformop parameter in TensorReduceFunctorImpl, it's better to have the same modification.
paddle/fluid/operators/renorm_op.cu
Outdated
UnsignedPowFunctor<MT, T>>( | ||
cuda_ctx, ins, &outs, func); | ||
std::vector<int> reduce_axis = {0, 2}; | ||
TensorReduceFunctorImpl<T, T, CustomSum>(pow_value, &dim_value, reduce_axis, |
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.
Recently, this PR add the transformop parameter in TensorReduceFunctorImpl, it's better to have the same modification.
python/paddle/tensor/math.py
Outdated
@@ -1069,6 +1069,31 @@ def addmm(input, x, y, beta=1.0, alpha=1.0, name=None): | |||
type="addmm", inputs=inputs, attrs=attrs, outputs={"Out": out}) | |||
return out | |||
|
|||
def renorm(input, p, dim, max_norm): |
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.
parameter "input" should be "x" like other Python API and "dim" should be "axis"
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
New features
PR changes
OPs
Describe
renorm op