diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-09-24 11:28:07 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-24 11:37:28 -0700 |
commit | 28eeda839f124cf5ba648576e86214b38141e4ab (patch) | |
tree | ab662878c5af9b531fab0592148c716740d1c750 /tensorflow/python/eager | |
parent | 5fbb064ba1e78bb28f7adbe92e6583c3b2bdfda7 (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: 214300210
Diffstat (limited to 'tensorflow/python/eager')
-rw-r--r-- | tensorflow/python/eager/function_test.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/python/eager/function_test.py b/tensorflow/python/eager/function_test.py index e4513cc87c..04f42f63d4 100644 --- a/tensorflow/python/eager/function_test.py +++ b/tensorflow/python/eager/function_test.py @@ -1602,7 +1602,7 @@ class FunctionTest(test.TestCase): defun_add = function.defun_with_attributes( add, attributes={'experimental_3': True, 'experimental_4': 1.0}) - with context.graph_mode(), self.test_session(): + with context.graph_mode(), self.cached_session(): with ops.get_default_graph().as_default(): t = constant_op.constant([[1.0, 2.0], [3.0, 4.0]]) sq = matmul(t, t) @@ -1636,7 +1636,7 @@ class FunctionTest(test.TestCase): with self.assertRaisesRegexp(ValueError, '.*Attribute name is not whitelisted.*'): - with context.graph_mode(), self.test_session(): + with context.graph_mode(), self.cached_session(): with ops.get_default_graph().as_default(): t = constant_op.constant([[1.0, 2.0], [3.0, 4.0]]) matmul(t, t) @@ -1647,7 +1647,7 @@ class FunctionTest(test.TestCase): with self.assertRaisesRegexp(ValueError, '.*Unsupported attribute type.*'): - with context.graph_mode(), self.test_session(): + with context.graph_mode(), self.cached_session(): with ops.get_default_graph().as_default(): t = constant_op.constant([[1.0, 2.0], [3.0, 4.0]]) add(t, t) |