aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/decode_raw_op_test.py
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-13 00:05:23 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-13 00:09:08 -0700
commit626bc997c28e1dfeaa85041e6c5a057fec7e0a02 (patch)
tree288347a8327ed2d0e15cd295e01cef7398c7af89 /tensorflow/python/kernel_tests/decode_raw_op_test.py
parent845aaec5ec2191f2708247a09d9bad37f012f536 (diff)
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
Diffstat (limited to 'tensorflow/python/kernel_tests/decode_raw_op_test.py')
-rw-r--r--tensorflow/python/kernel_tests/decode_raw_op_test.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tensorflow/python/kernel_tests/decode_raw_op_test.py b/tensorflow/python/kernel_tests/decode_raw_op_test.py
index 122a9ed469..dc01f4196a 100644
--- a/tensorflow/python/kernel_tests/decode_raw_op_test.py
+++ b/tensorflow/python/kernel_tests/decode_raw_op_test.py
@@ -29,7 +29,7 @@ from tensorflow.python.platform import test
class DecodeRawOpTest(test.TestCase):
def testToUint8(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[2])
decode = parsing_ops.decode_raw(in_bytes, out_type=dtypes.uint8)
self.assertEqual([2, None], decode.get_shape().as_list())
@@ -47,7 +47,7 @@ class DecodeRawOpTest(test.TestCase):
decode.eval(feed_dict={in_bytes: ["short", "longer"]})
def testToInt16(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[None])
decode = parsing_ops.decode_raw(in_bytes, out_type=dtypes.int16)
self.assertEqual([None, None], decode.get_shape().as_list())
@@ -62,7 +62,7 @@ class DecodeRawOpTest(test.TestCase):
decode.eval(feed_dict={in_bytes: ["123", "456"]})
def testEndianness(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[None])
decode_le = parsing_ops.decode_raw(
in_bytes, out_type=dtypes.int32, little_endian=True)
@@ -74,7 +74,7 @@ class DecodeRawOpTest(test.TestCase):
self.assertAllEqual([[0x01020304]], result)
def testToFloat16(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[None])
decode = parsing_ops.decode_raw(in_bytes, out_type=dtypes.float16)
self.assertEqual([None, None], decode.get_shape().as_list())
@@ -85,7 +85,7 @@ class DecodeRawOpTest(test.TestCase):
self.assertAllEqual(expected_result, result)
def testEmptyStringInput(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[None])
decode = parsing_ops.decode_raw(in_bytes, out_type=dtypes.float16)
@@ -94,7 +94,7 @@ class DecodeRawOpTest(test.TestCase):
self.assertEqual((num_inputs, 0), result.shape)
def testToUInt16(self):
- with self.test_session():
+ with self.cached_session():
in_bytes = array_ops.placeholder(dtypes.string, shape=[None])
decode = parsing_ops.decode_raw(in_bytes, out_type=dtypes.uint16)
self.assertEqual([None, None], decode.get_shape().as_list())