aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/kernel_tests/attention_ops_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/attention_ops_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/attention_ops_test.py')
-rw-r--r--tensorflow/python/kernel_tests/attention_ops_test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/python/kernel_tests/attention_ops_test.py b/tensorflow/python/kernel_tests/attention_ops_test.py
index fb74698660..1e09ba5b65 100644
--- a/tensorflow/python/kernel_tests/attention_ops_test.py
+++ b/tensorflow/python/kernel_tests/attention_ops_test.py
@@ -84,7 +84,7 @@ class ExtractGlimpseTest(test.TestCase):
image_ops.extract_glimpse(t_cols_4d, t1, t2), [0, 2, 1, 3]))
# Evaluate the TensorFlow Graph.
- with self.test_session() as sess:
+ with self.cached_session() as sess:
value_rows, value_cols = sess.run([glimpse_rows, glimpse_cols])
# Check dimensions of returned glimpse.
@@ -118,7 +118,7 @@ class ExtractGlimpseTest(test.TestCase):
def testEmptyTensor(self):
empty_image = np.zeros((0, 4, 3, 0))
offsets = np.zeros((0, 2))
- with self.test_session():
+ with self.cached_session():
result = image_ops.extract_glimpse(empty_image, [1, 1], offsets)
self.assertAllEqual(
np.zeros(