-
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 complex tensors for Inv operation #22952
Comments
.take |
Thank you for looking into this issue! Please let us know if you have any questions or require any help. |
@rkazants Hello, I have compiled openvino with
and set environment variables
when I run test_tf_Reshape.py
Something wrong happend:
What should I do to fix this? |
@rkazants This helps solve the problem above, but there's another problem:
|
Hi @linzs148, For running tests you should build your openvino wheel that you will test using the layer tests and install it. Check out this documentation: https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/build_linux.md.
|
Thanks! This makes sense for me. By the way, my Linux server doesn't have an intel GPU so only tests for CPU can pass. What should I do to test in GPU? |
@rkazants Hi, I added some tests for complex inv and got an error while running pytest:
What should I do to fix this? |
Just launch the tests only on CPU.
|
Please fix your test and align with other layer tests. We recently removed |
@rkazants Hi, I have modified and compiled
Should I reinstall openvino with wheel or do something else? PS: I have changed |
Hi @linzs148, please post PR I will take a look. It can be a problem with the layer test and also with update of the translator. BTW, are you participating in GSoC? Or just performing it as GFI? Best regards, |
@rkazants Hi, what should I do next for this issue? |
**Ticket:** #22952 --------- Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
**Ticket:** openvinotoolkit#22952 --------- Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
**Ticket:** openvinotoolkit#22952 --------- Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
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.
Some audio models use tensors of complex type. Complex type tensor is a tensor that has elements of complex type. For example, 1D tensor with three elements
x = [1+2j, 2, -2j]
.For supporting Inv operation on complex type tensor, you need to extend the corresponding loader for Inv.
What needs to be done?
The existing loader for Inv needs to be extended by propagating
ComplexTypeMark
from input to output and to represent output complex type tensor as a floating-point type tensor with auxiliary dimension that concatenates real and imaginary parts of complex tensor.To validate the extension, the corresponding layer test needs to be updated with complex tensor cases.
Here is an example of how to extend
Reshape
loader to support complex type tensors:Since OpenVINO does not have native support of complex tensors, we handle complex type in intermediate layers by representing them as a floating-point type with additional dimension (specially created) to store real and imaginary parts of the original complex tensor so slicing by the last dimension will give either real or imaginary parts:
x[...,0]
- real andx[...,1]
- imaginary parts.On the first step, we update
default_op_checks
withtrue
flag to indicate that loader forReshape
operation now handles complex tensors:Secondly, we check if complex type mark exists by anticipated inputs. This mark indicates that input tensor of complex type:
Thirdly, we retrieve a floating-point tensor (with additional dimension to store real and imaginary parts) simulating complex tensor:
After that, we implement conversion for
Reshape
for this particular case. Since a floating-point tensor simulating complex tensor has additional dimension equal to 2,we update input target shape by appending
2
value and perform reshape on a floating-point tensor simulating complex tensor.Finally, since
Reshape
should produce complex tensor by output we insert a new markComplexTypeMark
into the output.To validate support of complex tensors for
Reshape
, the new layer test TestComplexReshape was added.Example how to run the layer test:
Example Pull Requests
Shape
,Mul
,Reshape
in [TF FE] Complex type support extended for Separate Bass model. #21477Roll
operation in [TF FE] Support Complex Tensors #20860Resources
Contact points
Ticket
No response
The text was updated successfully, but these errors were encountered: