-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Good First Issue] [TF FE]: Support Atan2 operation for TensorFlow models #20754
Comments
Hey! @rkazants I'd like to work on this project can i get started? |
Sure, very welcome to contribute. The task is yours. Best regards, |
Hi @rghvsh, is there progress with this task? Please let me know if you need some help. Thanks, |
Hi @rghvsh, please pay attention that it is Not sufficient to add:
That is because Best regards, |
Got it! |
Hey! @rkazants Is this code correct for this issue wanted to check with and get your feed back before a PR. If there are any mistakes I'll fix them ASAP. Thank You #include "common_op_table.hpp" using namespace std; namespace ov {
} |
Hi @rghvsh, Not quite correct:).
Examples to build sub-graph you can find in other loaders. Example: https://github.com/openvinotoolkit/openvino/blob/master/src/frontends/tensorflow_common/src/op/xdivy.cpp. Best regards, |
I see I'll start doing this |
Hey! @rkazants Update:
had a question about the input which will be a NodeClass type object what will be stored in the class can you point me towards the documentation tried finding but got none Thank You |
Hi @rghvsh, Great, keep this way. I think you mean This documentation might be helpful but see already implemented loaders as examples too:) Best regards, |
Hi @rghvsh. Do you have progress working on this task. Please let me know if you need help. Best regards, |
Hey @rkazants I've made progress and am working in it.
Sure! Thank You |
default_op_checks(node, 2, {"atan2"}); Hey @rkazants this stament unpacks the the node object and gets x and y which are of Tensor datatype how to iterate over these(x and y). |
Hi @rghvsh, Not sure how you would like to iterate. You just need to build a graph on down of
Use Best regards, |
Hey @rkazants UPDATE : In the second case we have two conditions how will those be implemented do we have to use somethging like this
and is this right way to make a pi constant
Sorry for asking too many questions its my first time contributing to a large codebase. Thank You |
Hi @rghvsh, Sorry for the delay. Here is an pseudo-code how to represent these conditions using our opset:
For undefined behaviour, we can do nothing. Hope this helps. Best regards, |
Context
OpenVINO component responsible for support of TensorFlow models is called as TensorFlow Frontend (TF FE). TF FE converts a model represented in TensorFlow opset to a model in OpenVINO opset.
In order to infer TensorFlow models with Atan2 operation by OpenVINO, TF FE needs to be extended with this operation support.
What needs to be done?
For Atan2 operation support, you need to add the corresponding loader into TF FE op directory and to register it into the dictionary of Loaders. One loader is responsible for conversion (or decomposition) of one type of TensorFlow operation.
Here is an example of loader implementation for TensorFlow
Einsum
operation:In this example,
translate_einsum_op
converts TFEinsum
into OVEinsum
.NodeContext
object passed into the loader packs all info about inputs and attributes ofEinsum
operation. The loader retrieves an attribute of the equation by using theNodeContext::get_attribute()
method, prepares input vector, createsEinsum
operation from OV opset and returns a vector of outputs.Responsibility of a loader is to parse operation attributes, prepare inputs and express TF operation via OV operations sub-graph. Example for
Einsum
demonstrates the resulted sub-graph with one operation. In PR #19007 you can see operation decomposition into multiple node sub-graph.Hint
The output range values for
Atan2
is[-pi; +pi]
different fromAtan
. You need to pay attention to signs of operandsx
andy
. For more information, read the details in wiki.Example Pull Requests
Resources
Contact points
@openvinotoolkit/openvino-tf-frontend-maintainers
Ticket
TBD
The text was updated successfully, but these errors were encountered: