Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the output of
tf.argmax
as index type
This fix tries to fix the issue raised in tensorflow#8951 where the following will raise a `TypeError`: ``` a = tf.constant([1, 2, 3], dtype=tf.float32) b = tf.argmax(a) tf.Session().run(a[b]) TypeError: Input 'strides' of 'StridedSlice' Op has type int32 that does not match type int64 of argument 'begin'. ``` The reason for the erorr is that, `strides` is added as `append(1)` without type while `begin` is appended with type. The mismatch of `strides` and `begin` causes the error. This fix fixes the issue by cast the stride with the same type as `begin` when needed. This issue was raised in tensorflow#8951. It was also raised earlier in tensorflow#206 (comment) This fix fixes tensorflow#8951. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
- Loading branch information