-
Notifications
You must be signed in to change notification settings - Fork 74k
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 discrepancy between doc and impl for tf.reverse
#13672
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fix tries to address the discrepancy between doc and implementations for `tf.reverse`. In the documentation, both int32 and int64 could be used for axis. However, the actual implementation of the `tf.reverse` does not support int64 and caused missing kernel error: ```python ubuntu@ubuntu:~$ python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf >>> v = tf.reverse_v2([1, 2, 3], tf.constant([0], tf.int64)) >>> sess = tf.Session() >>> sess.run(v) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 889, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1120, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1317, in _do_run options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1336, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'ReverseV2' with these attrs. Registered devices: [CPU], Registered kernels: device='CPU'; T in [DT_STRING]; Tidx in [DT_INT32] device='CPU'; T in [DT_BOOL]; Tidx in [DT_INT32] device='CPU'; T in [DT_COMPLEX128]; Tidx in [DT_INT32] device='CPU'; T in [DT_COMPLEX64]; Tidx in [DT_INT32] device='CPU'; T in [DT_DOUBLE]; Tidx in [DT_INT32] device='CPU'; T in [DT_FLOAT]; Tidx in [DT_INT32] device='CPU'; T in [DT_HALF]; Tidx in [DT_INT32] device='CPU'; T in [DT_INT8]; Tidx in [DT_INT32] device='CPU'; T in [DT_UINT8]; Tidx in [DT_INT32] device='CPU'; T in [DT_INT16]; Tidx in [DT_INT32] device='CPU'; T in [DT_UINT16]; Tidx in [DT_INT32] device='CPU'; T in [DT_INT32]; Tidx in [DT_INT32] device='CPU'; T in [DT_INT64]; Tidx in [DT_INT32] [[Node: ReverseV2 = ReverseV2[T=DT_INT32, Tidx=DT_INT64](ReverseV2/tensor, Const)]] ``` This fix addresses this issue and added the int64 support for axis in `tf.reverse`. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Can one of the admins verify this patch? |
@tensorflow-jenkins test this please |
martinwicke
added
awaiting review
Pull request awaiting review
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
labels
Nov 8, 2017
ping @aselle |
martinwicke
added
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
and removed
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
labels
Dec 12, 2017
aselle
approved these changes
Dec 16, 2017
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 thanks for the submission
drpngx
added
awaiting testing (then merge)
kokoro:force-run
Tests on submitted change
and removed
stat:awaiting tensorflower
Status - Awaiting response from tensorflower
labels
Dec 27, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix tries to address the discrepancy between doc and implementations for
tf.reverse
. In the documentation, both int32 and int64 could be used for axis.However, the actual implementation of the
tf.reverse
does not support int64 and caused missing kernel error:This fix addresses this issue and added the int64 support for axis in
tf.reverse
.Signed-off-by: Yong Tang yong.tang.github@outlook.com