Open rkazants opened 6 months ago
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
I am having question regarding the pytest. To run the desired python code to test the C++ code changes, should I need to add the test cases to check for the desired results?
Hi @AtharvaPore01,
Sorry for delay in response, I missed your message. For validation of C++ part required in this task, we use pytest based validation. BTW, any update on this task?
Best regards, Roman
Hello @rkazants,
I apologize for the delay. I'm currently working on the task and endeavoring to submit it on time. Due to some prior commitments, I wasn't able to progress as quickly as I would have liked, but rest assured, I am actively working on it.
Best regards, Atharva
Hello @AtharvaPore01, are you still working on this? Is there anything we could help you with?
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Hi! @rkazants, Is this the correct way to do this
if (complex_type_mark) {
element::Type complex_part_type = complex_type_mark->get_complex_part_type();
input = complex_type_mark->input_value(0);
auto unsqueeze = make_shared<v0::Unsqueeze>(input, axis);
set_node_name(node.get_name(), unsqueeze);
return {unsqueeze};
}
cc @rkazants
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 ExpandDims operation on complex type tensor, you need to extend the corresponding loader for ExpandDims.
What needs to be done?
The existing loader for ExpandDims 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 appending2
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 https://github.com/openvinotoolkit/openvino/pull/21477Roll
operation in https://github.com/openvinotoolkit/openvino/pull/20860Resources
Contact points
Ticket
No response