aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/slice_op_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/kernel_tests/slice_op_test.py')
-rw-r--r--tensorflow/python/kernel_tests/slice_op_test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/slice_op_test.py b/tensorflow/python/kernel_tests/slice_op_test.py
index 29f76a2182..c11f78b77e 100644
--- a/tensorflow/python/kernel_tests/slice_op_test.py
+++ b/tensorflow/python/kernel_tests/slice_op_test.py
@@ -269,6 +269,15 @@ class SliceTest(test.TestCase):
c = array_ops.slice(a, [begin, 0], [-1, 2])
self.assertEqual([None, 2], c.get_shape().as_list())
+ def testSliceOfSlice(self):
+ with self.test_session(use_gpu=True):
+ a = constant_op.constant([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]])
+ b = a[1:, :]
+ c = b[:-1, :]
+ d = c[1, :]
+ res = 2 * d - c[1, :] + a[2, :] - 2 * b[-2, :]
+ self.assertAllEqual([0, 0, 0], res.eval())
+
if __name__ == "__main__":
test.main()