Support degenerate strided slicing under XLA.
authorIgor Ganichev <iga@google.com>
Fri, 23 Feb 2018 00:42:55 +0000 (16:42 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 23 Feb 2018 00:55:11 +0000 (16:55 -0800)
commit29859199de4b15b94e4e94d8fe632aeeb34c4991
tree3e5dc4ebc5d824e602caef3420d700af777fe03d
parentd4bf5b2a6f081e8c6e0dbbdd2da1b55e25695232
Support degenerate strided slicing under XLA.

For example, when start, end, and stride are all positive, but `start` is
greater than `end`, tf2xla used to raise an error instead of returning a
tensor with that dimension size being 0. Latter is the regular
tensorflow and python behavior. This change makes XLA behave the same
way.

PiperOrigin-RevId: 186695842
tensorflow/compiler/tests/slice_ops_test.py
tensorflow/compiler/tf2xla/kernels/strided_slice_op.cc