-
Notifications
You must be signed in to change notification settings - Fork 359
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
Atan2 converter #1381
Atan2 converter #1381
Conversation
- Add atan2 converter - Update test cases to reflect edge cases with quadrants of atan2 - Ensure quadrants are respected based on signs of input Tensors - Fix bug in implementation relating to quadrant correction
Hi @gs-olive! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
auto ZERO = tensor_to_const(ctx, torch::tensor({0.})); | ||
auto ONE = tensor_to_const(ctx, torch::tensor({1.})); | ||
auto TWO = tensor_to_const(ctx, torch::tensor({2.})); | ||
auto PI = tensor_to_const(ctx, torch::tensor({M_PI})); |
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.
Here is PyTorch's PI definition. I think c10::pi<float>()
should be right. Please make a note that we'd prefer double from a pytorch perspective.
@@ -1,3 +1,4 @@ | |||
#include <c10/util/MathConstants.h> |
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.
small style thing, I know other files might use <>
to include torch, libraries but use ""
for anything other than stdlib
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.
I updated the <>
notation to ""
on both this new import, as well as the existing torch/torch.h import in this file
…into atan2_converter
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Description
This feature adds the atan2 converter, as mentioned in Issue #938.
Fixes #938
Type of change
Checklist: