Possible bug: tf.reverse() does not accept bool type 'dim' argument in r0.12
I think tf.reverse() got messed up in r0.12. Though the documentation says the argument 'dim' has to be 'bool', while running it complains -- "Value passed to parameter 'axis' has DataType bool not in list of allowed values: int32, int64". I can see that this comes from a new op -- tf.reverse_v2(). I saw that in r0.11 this runs with no complains. I have prepared a mwe for this (link provided below). Either the documentation needs to be updated (for r0.12) or this needs to be fixed so that dims can accept boolean. I'd, rather, opt for a fix as this might be a reason for backward incompatibility in some legacy code.
Environment info
Operating System: Centos 7 Installed version of CUDA and cuDNN: cuda 8.0, cuDNN 5.1 If installed from source, provide
- The commit hash (
git rev-parse HEAD): e4dde23d58a10c9d0c14005d20d1ecdd599539ac - The output of
bazel version- 4.2
If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)
I have prepared a mwe for this (Just 26 lines of code). This tries to reproduce one of the examples given in the documentation. Attached here
Logs or other output that would be helpful
Traceback (most recent call last):
File "mwe.py", line 16, in
There's been some backward incompatible changes: https://github.com/tensorflow/tensorflow/blob/c72d891418c326794a913cc13382c104255fe1f2/RELEASE.md#breaking-changes-to-the-api
tf.reverse() now takes indices of axes to be reversed. E.g. tf.reverse(a, [True, False, True]) must now be written as tf.reverse(a, [0, 2]). tf.reverse_v2() will remain until 1.0 final.
does that help?
@yaroslavvb, I see. Thats quite a list. Yes, the workaround works. I just thought, as it is not conforming to the documentation, it might be an unintentional bug. Please close the issue if its not unintentional.
I suspect you were looking at the wrong documentation -- your commit hash is 21 hours old so you have a version newer than 0.12 and should be looking at documentation from head. Navigate to "VERSIONS" and click HEAD, the link should be: https://www.tensorflow.org/versions/master/api_docs/python/array_ops/slicing_and_joining#reverse
@yaroslavvb, got it. I never knew I can get the latest documentation in such way. Thanks for the pointer. Closing the issue.