-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[TF FE] Add complex tensor support for ReverseSequence operation #29482
base: master
Are you sure you want to change the base?
[TF FE] Add complex tensor support for ReverseSequence operation #29482
Conversation
|
||
test_data_complex = [ | ||
dict(input_shape=[4, 5], seq_lengths_type=np.int32, seq_dim=1, batch_dim=0), | ||
dict(input_shape=[2, 3, 4], seq_lengths_type=np.int32, seq_dim=1, batch_dim=0), |
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.
please add test cases for negative batch_dim
and seq_dim
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've added the test cases with negative batch_dim and seq_dim values as you asked, but there's a small issue - the test function has assertions that check if dimensions are non-negative:
assert 0 <= batch_dim and batch_dim < len(input_shape)
assert 0 <= seq_dim and seq_dim < len(input_shape)
I think these assertions will fail with negative indices. Should I also modify the assertions to handle negative indices by converting them to positive equivalent first? Or you want to keep the assertions and modify something else?
Let me know what you think is best approach for this! Thanks!
build_jenkins |
Changes
ComplexTypeMark
propagation from input to outputtrue
flag todefault_op_checks
to handle complex tensor inputsReason for changes
Some audio models use complex type tensors which weren't supported by the ReverseSequence operation in the TensorFlow Frontend. This PR extends the loader to properly handle complex tensors following the same pattern used for other operations like Reshape. Complex tensors are represented as floating-point tensors with an auxiliary dimension to concatenate real and imaginary parts.
Tests
TestComplexReverseSequence
class with test cases for complex tensors