diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-09-21 00:07:20 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-21 00:13:08 -0700 |
commit | b19d6657070bbf1df5706195a0bf3a92cbf371fc (patch) | |
tree | 64279a06acd61c7028226eba46a05dd1127acee4 /tensorflow/contrib/resampler | |
parent | 2952f5134905af795ba90ae1eb97e39091ba9843 (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: 213944932
Diffstat (limited to 'tensorflow/contrib/resampler')
-rw-r--r-- | tensorflow/contrib/resampler/python/ops/resampler_ops_test.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/resampler/python/ops/resampler_ops_test.py b/tensorflow/contrib/resampler/python/ops/resampler_ops_test.py index 6253f96315..e30e7255fa 100644 --- a/tensorflow/contrib/resampler/python/ops/resampler_ops_test.py +++ b/tensorflow/contrib/resampler/python/ops/resampler_ops_test.py @@ -210,7 +210,7 @@ class ResamplerTest(test.TestCase): # Input data shape is not defined over a 2D grid, i.e. its shape is not like # (batch_size, data_height, data_width, data_channels). - with self.test_session() as sess: + with self.cached_session() as sess: data_shape = (batch_size, data_height, data_width, data_depth, data_channels) data = np.zeros(data_shape) @@ -225,7 +225,7 @@ class ResamplerTest(test.TestCase): sess.run(outputs) # Warp tensor must be at least a matrix, with shape [batch_size, 2]. - with self.test_session() as sess: + with self.cached_session() as sess: data_shape = (batch_size, data_height, data_width, data_channels) data = np.zeros(data_shape) warp_shape = (batch_size,) @@ -238,7 +238,7 @@ class ResamplerTest(test.TestCase): sess.run(outputs) # The batch size of the data and warp tensors must be the same. - with self.test_session() as sess: + with self.cached_session() as sess: data_shape = (batch_size, data_height, data_width, data_channels) data = np.zeros(data_shape) warp_shape = (batch_size+1, warp_height, warp_width, 2) @@ -252,7 +252,7 @@ class ResamplerTest(test.TestCase): # The warp tensor must contain 2D coordinates, i.e. its shape last dimension # must be 2. - with self.test_session() as sess: + with self.cached_session() as sess: data_shape = (batch_size, data_height, data_width, data_channels) data = np.zeros(data_shape) warp_shape = (batch_size, warp_height, warp_width, 3) |