diff options
author | 2018-08-21 19:24:19 -0700 | |
---|---|---|
committer | 2018-08-21 19:27:54 -0700 | |
commit | 496023e9dc84a076caeb2e5e8e13b6a3d819ad6d (patch) | |
tree | 9776c9865f7b98a15817bc6be4c2b683323a67b1 /tensorflow/contrib/labeled_tensor | |
parent | 361a82d73a50a800510674b3aaa20e4845e56434 (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: 209701635
Diffstat (limited to 'tensorflow/contrib/labeled_tensor')
-rw-r--r-- | tensorflow/contrib/labeled_tensor/python/ops/ops_test.py | 2 | ||||
-rw-r--r-- | tensorflow/contrib/labeled_tensor/python/ops/test_util.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/labeled_tensor/python/ops/ops_test.py b/tensorflow/contrib/labeled_tensor/python/ops/ops_test.py index 39e9d65407..9a402d888c 100644 --- a/tensorflow/contrib/labeled_tensor/python/ops/ops_test.py +++ b/tensorflow/contrib/labeled_tensor/python/ops/ops_test.py @@ -270,7 +270,7 @@ class ReshapeTest(Base): array_ops.placeholder(dtypes.float32, [None]), ['x']) reshape_lt = ops.reshape(orig_lt, ['x'], ['y', ('z', 1)]) self.assertEqual(reshape_lt.axes, core.Axes([('y', None), ('z', 1)])) - with self.test_session() as sess: + with self.cached_session() as sess: result = sess.run(reshape_lt, feed_dict={orig_lt.tensor: [1, 2]}) np.testing.assert_array_equal(result, [[1], [2]]) diff --git a/tensorflow/contrib/labeled_tensor/python/ops/test_util.py b/tensorflow/contrib/labeled_tensor/python/ops/test_util.py index 8f0416030f..900c9217c3 100644 --- a/tensorflow/contrib/labeled_tensor/python/ops/test_util.py +++ b/tensorflow/contrib/labeled_tensor/python/ops/test_util.py @@ -27,7 +27,7 @@ class Base(test.TestCase): """A class with some useful methods for testing.""" def eval(self, tensors): - with self.test_session() as sess: + with self.cached_session() as sess: coord = coordinator.Coordinator() threads = queue_runner_impl.start_queue_runners(sess=sess, coord=coord) |