aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/array_ops_test.py
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2017-08-24 19:16:03 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-24 19:20:28 -0700
commit80341a3ac5e14d36aad4c5cd9e9a6d4479235017 (patch)
tree340f5e38a90394953d848d54298ead28e82016b6 /tensorflow/python/kernel_tests/array_ops_test.py
parentb486f75b4cf6fc937f4ac1a408be6fb6470150d2 (diff)
StridedSliceOp: GPU kernel for 64-bit indices
The TypeConstraint was unnecessary. The kernel implementation was correctly converting both DT_INT32 and DT_INT64 tensors to an InlinedVector<int64, 4>. PiperOrigin-RevId: 166427269
Diffstat (limited to 'tensorflow/python/kernel_tests/array_ops_test.py')
-rw-r--r--tensorflow/python/kernel_tests/array_ops_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tensorflow/python/kernel_tests/array_ops_test.py b/tensorflow/python/kernel_tests/array_ops_test.py
index 11213bee3c..2cfbb63de8 100644
--- a/tensorflow/python/kernel_tests/array_ops_test.py
+++ b/tensorflow/python/kernel_tests/array_ops_test.py
@@ -475,6 +475,17 @@ class StridedSliceTest(test_util.TensorFlowTestCase):
_ = checker2[...]
_ = checker2[tuple()]
+ def testInt64GPU(self):
+ if not test_util.is_gpu_available():
+ self.skipTest("No GPU available")
+ with self.test_session(use_gpu=True, force_gpu=True):
+ x = constant_op.constant([1., 2., 3.])
+ begin = constant_op.constant([2], dtype=dtypes.int64)
+ end = constant_op.constant([3], dtype=dtypes.int64)
+ strides = constant_op.constant([1], dtype=dtypes.int64)
+ s = array_ops.strided_slice(x, begin, end, strides)
+ self.assertAllEqual([3.], self.evaluate(s))
+
def testDegenerateSlices(self):
with self.test_session(use_gpu=True):
checker = StridedSliceChecker(self, StridedSliceChecker.REF_TENSOR)