aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/tests/pooling_ops_test.py
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-08-22 15:06:15 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-22 15:15:31 -0700
commitcd199a89dbffdd55aa2fc89acb874763382f196d (patch)
tree831b17c85b5c7c8257cc05bbc7d8940db8be0b32 /tensorflow/compiler/tests/pooling_ops_test.py
parentd44030304e4c0a50a3169ea06b528bd780780acb (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: 209837298
Diffstat (limited to 'tensorflow/compiler/tests/pooling_ops_test.py')
-rw-r--r--tensorflow/compiler/tests/pooling_ops_test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/compiler/tests/pooling_ops_test.py b/tensorflow/compiler/tests/pooling_ops_test.py
index 9fc94752ea..d03bd4fdbb 100644
--- a/tensorflow/compiler/tests/pooling_ops_test.py
+++ b/tensorflow/compiler/tests/pooling_ops_test.py
@@ -89,7 +89,7 @@ class PoolingTest(xla_test.XLATestCase):
# numbers from 1.
x = np.array([f * 1.0 for f in range(1, total_size + 1)], dtype=np.float32)
x = x.reshape(input_sizes)
- with self.test_session() as sess:
+ with self.cached_session() as sess:
with self.test_scope():
inputs = array_ops.placeholder(dtypes.float32)
t = inputs
@@ -324,7 +324,7 @@ class PoolGradTest(xla_test.XLATestCase):
# TODO(b/74222344): Fix nan handling for max pool grad.
# x[np.random.choice(total_size)] = np.nan
x = x.reshape(input_sizes)
- with self.test_session() as sess:
+ with self.cached_session() as sess:
# Use the forward pool function to compute some corresponding outputs
# (needed for the CPU device, and we need the shape in both cases).
with ops.device(self.CPU_DEVICE):