From 28eeda839f124cf5ba648576e86214b38141e4ab Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 24 Sep 2018 11:28:07 -0700 Subject: 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: 214300210 --- tensorflow/examples/autograph/integration_tests/errors_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tensorflow/examples') diff --git a/tensorflow/examples/autograph/integration_tests/errors_test.py b/tensorflow/examples/autograph/integration_tests/errors_test.py index 69e5936832..9c10dad9aa 100644 --- a/tensorflow/examples/autograph/integration_tests/errors_test.py +++ b/tensorflow/examples/autograph/integration_tests/errors_test.py @@ -92,7 +92,7 @@ class ErrorsTest(tf.test.TestCase): compiled_fn = ag.to_graph(test_fn) with self.assertRaises(ag.TfRuntimeError) as error: - with self.test_session() as sess: + with self.cached_session() as sess: x = compiled_fn(tf.constant([4, 8])) with ag.improved_errors(compiled_fn): sess.run(x) @@ -134,7 +134,7 @@ class ErrorsTest(tf.test.TestCase): # frame with "g" as the function name but because we don't yet add # try/except blocks to inner functions the name is "tf__g". with self.assertRaises(ag.TfRuntimeError) as error: - with self.test_session() as sess: + with self.cached_session() as sess: x = compiled_fn(tf.constant([4, 8])) with ag.improved_errors(compiled_fn): sess.run(x) -- cgit v1.2.3