-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Feature/mod op #5454
Feature/mod op #5454
Conversation
This depends on the #5455, need the CopyToVector function. |
|
||
REGISTER_OP_GPU_KERNEL( | ||
elementwise_mod, | ||
ops::ElementwiseModKernel<paddle::platform::GPUPlace, int>); |
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.
Let it be int64
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.
Since our python test is int32, here should be int. And many of our operators need to support multi-types. Duplicate the different types need to be supported in a more elegant manner.
#5646
ElementwiseModOpMaker(framework::OpProto* proto, | ||
framework::OpAttrChecker* op_checker) | ||
: ElementwiseOpMaker(proto, op_checker) { | ||
SetComment("Mod", "$Out = X % Y$"); |
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.
Comment is too simple. Maybe add some explains about the formular
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.
void Compute(const framework::ExecutionContext& ctx) const override { | ||
using Tensor = framework::Tensor; | ||
|
||
// only support Tensor % Scalar |
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.
The unit test's Y
seems not a scalar?
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.
fix 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.
Test seems failed?
Since you haven't replied for a long time, we have closed this issue/pr. |
add mod operator