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
Fix crash with tf.transpose when a is complex and conjugate is True #46973
Fix crash with tf.transpose when a is complex and conjugate is True #46973
Conversation
b28c1f3
to
dc69ff1
Compare
@rohan100jain @cantonios thanks for the review. The PR has been updated. Please take a look. |
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.
LGTM.
Ideally those extra tests would be folded into the original testComplex64/128
, which already tests different tensor ranks. Though with the current v1 decorator and the need to update these tests anyways for v2, this is probably fine for now.
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.
@yongtang I updated the entire test to TF v2, so can you now merge your tests into testComplex64()
and testComplex128()
?
Something like this would work:
self._testBoth(np.array(np.complex(1, 2)).astype(np.complex128))
self._testBoth(np.complex(1, 2) * np.arange(0, 21).astype(np.complex128))
This PR tries to address the issue raised in 46891 where tf.transpose will crash when a is complex and conjugate is True. The issue comes from: https://github.com/tensorflow/tensorflow/blob/57bbc5e0d4b93483b8ae853352173516f1c08018/tensorflow/core/kernels/transpose_functor.h#L169 However, as ndims < 2 has already been handled properly: https://github.com/tensorflow/tensorflow/blob/57bbc5e0d4b93483b8ae853352173516f1c08018/tensorflow/core/kernels/transpose_functor_cpu.cc#L103-L105 The check could be removed. This PR fixes 46891. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
dc69ff1
to
20245fc
Compare
Thanks @cantonios for the help. The PR has been updated. Please take a look and let me know if there are any issues. |
…omplex128() with additional update to sort test cases in increasing rank order Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
20245fc
to
6cbc31d
Compare
Thanks @cantonios for the help. The PR has been updated. Please let me know if there are any additional issues. |
This PR tries to address the issue raised in #46891 where
tf.transpose will crash when a is complex and conjugate is True.
The issue comes from:
tensorflow/tensorflow/core/kernels/transpose_functor.h
Line 169 in 57bbc5e
However, as ndims < 2 has already been handled properly:
tensorflow/tensorflow/core/kernels/transpose_functor_cpu.cc
Lines 103 to 105 in 57bbc5e
The check could be removed.
This PR fixes #46891.
Signed-off-by: Yong Tang yong.tang.github@outlook.com