aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tensorflow/compiler/tests/slice_ops_test.py13
-rw-r--r--tensorflow/docs_src/performance/xla/operation_semantics.md2
2 files changed, 14 insertions, 1 deletions
diff --git a/tensorflow/compiler/tests/slice_ops_test.py b/tensorflow/compiler/tests/slice_ops_test.py
index 8f10c2fe86..2c611a959e 100644
--- a/tensorflow/compiler/tests/slice_ops_test.py
+++ b/tensorflow/compiler/tests/slice_ops_test.py
@@ -40,6 +40,19 @@ class SliceTest(xla_test.XLATestCase):
self.assertAllEqual([2, 3, 4, 5], result)
+ def testZeroSlice(self):
+ for dtype in self.numeric_types:
+ with self.cached_session():
+ i = array_ops.placeholder(dtype, shape=[2])
+ with self.test_scope():
+ o = array_ops.slice(i, [0], [0])
+ params = {
+ i: [0, 1],
+ }
+ result = o.eval(feed_dict=params)
+
+ self.assertAllEqual([], result)
+
def test3D(self):
for dtype in self.numeric_types:
with self.cached_session():
diff --git a/tensorflow/docs_src/performance/xla/operation_semantics.md b/tensorflow/docs_src/performance/xla/operation_semantics.md
index c23a7ad9e2..96d269bec4 100644
--- a/tensorflow/docs_src/performance/xla/operation_semantics.md
+++ b/tensorflow/docs_src/performance/xla/operation_semantics.md
@@ -2266,7 +2266,7 @@ arguments to the slice operation.
| `limit_indices` | `ArraySlice<int64>` | List of N integers containing the |
: : : ending indices (exclusive) for the :
: : : slice for each dimension. Each value :
-: : : must be strictly greater than the :
+: : : must be greater than or equal to the :
: : : respective `start_indices` value for :
: : : the dimension and less than or equal :
: : : to the size of the dimension. :