From 626bc997c28e1dfeaa85041e6c5a057fec7e0a02 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 13 Sep 2018 00:05:23 -0700 Subject: Move from deprecated self.test_session() to self.cached_session(). self.test_session() has been deprecated in 9962eb5e84b15e309410071b06c2ed2d6148ed44 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about: * the fact that the session may be reused. * the session is not closed even when doing a "with self.test_session()" statement. PiperOrigin-RevId: 212766976 --- tensorflow/python/kernel_tests/slice_op_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tensorflow/python/kernel_tests/slice_op_test.py') diff --git a/tensorflow/python/kernel_tests/slice_op_test.py b/tensorflow/python/kernel_tests/slice_op_test.py index 40d384c623..c08d3222b3 100644 --- a/tensorflow/python/kernel_tests/slice_op_test.py +++ b/tensorflow/python/kernel_tests/slice_op_test.py @@ -107,7 +107,7 @@ class SliceTest(test.TestCase): def testScalarInput(self): input_val = 0 - with self.test_session() as sess: + with self.cached_session() as sess: # Test with constant input; shape inference fails. with self.assertRaisesWithPredicateMatch(ValueError, "out of range"): constant_op.constant(input_val)[:].get_shape() @@ -121,7 +121,7 @@ class SliceTest(test.TestCase): def testInvalidIndex(self): input_val = [1, 2] - with self.test_session() as sess: + with self.cached_session() as sess: # Test with constant input; shape inference fails. with self.assertRaisesWithPredicateMatch(ValueError, "out of range"): constant_op.constant(input_val)[1:, 1:].get_shape() -- cgit v1.2.3