-
Notifications
You must be signed in to change notification settings - Fork 431
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
How to implement an Atan2 custom op? #1011
Comments
onnx doesn't have atan2 but we can maybe compose it with a couple of ops. |
Thanks for your reply, I have attempted implementing using the existing ops:
But I'm not sure how to handle the ifs statement to condition x and y (e.g: positive or negative) |
I think you'd need to come up with a new tensor to multiply the results with. |
I see, thank you for your help, yeah that's the example I'm using to create Atan2 |
The ifs can be handled by using the WHERE op if you are on opset >= 9 |
And the definitions here may be helpful: https://en.wikipedia.org/wiki/Atan2#Definition_and_computation |
yes, 'where' will do. |
I am trying to implement a conversion for tf.Atan2 and hoping to follow the implementation of Atan, however it is blank in tensorflow-onnx/tf2onnx/onnx_opset/math.py:
Does this mean I can also do a similar thing to Atan2, something like this:
or do I have to implement it using the existing layers?
The text was updated successfully, but these errors were encountered: