aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/transpose_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/transpose_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/transpose_op_test.py')
-rw-r--r--tensorflow/python/kernel_tests/transpose_op_test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/python/kernel_tests/transpose_op_test.py b/tensorflow/python/kernel_tests/transpose_op_test.py
index 290200ce45..f42800226e 100644
--- a/tensorflow/python/kernel_tests/transpose_op_test.py
+++ b/tensorflow/python/kernel_tests/transpose_op_test.py
@@ -451,13 +451,13 @@ class TransposeTest(test.TestCase):
array_ops.transpose(array_ops.placeholder(dtypes.int32)).get_shape())
def testNullTensor(self):
- with self.test_session():
+ with self.cached_session():
x = constant_op.constant([], dtype=dtypes.float32, shape=[1, 4, 0])
xt = array_ops.transpose(x, [0, 2, 1]).eval()
self.assertAllEqual(xt.shape, (1, 0, 4))
def _testError(self, x, p, err):
- with self.test_session():
+ with self.cached_session():
with self.assertRaisesOpError(err):
array_ops.transpose(x, p).eval()