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/keras | |
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/keras')
-rw-r--r-- | tensorflow/python/keras/engine/topology_test.py | 2 | ||||
-rw-r--r-- | tensorflow/python/keras/utils/multi_gpu_utils_test.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/python/keras/engine/topology_test.py b/tensorflow/python/keras/engine/topology_test.py index 061db8ee34..a0da96334b 100644 --- a/tensorflow/python/keras/engine/topology_test.py +++ b/tensorflow/python/keras/engine/topology_test.py @@ -915,7 +915,7 @@ class TopologyConstructionTest(test.TestCase): def test_constant_initializer_with_numpy(self): - with self.test_session(): + with self.cached_session(): initializer = keras.initializers.Constant(np.ones((3, 2))) model = keras.models.Sequential() model.add(keras.layers.Dense(2, input_shape=(3,), diff --git a/tensorflow/python/keras/utils/multi_gpu_utils_test.py b/tensorflow/python/keras/utils/multi_gpu_utils_test.py index d6016ed711..3d0351a11f 100644 --- a/tensorflow/python/keras/utils/multi_gpu_utils_test.py +++ b/tensorflow/python/keras/utils/multi_gpu_utils_test.py @@ -186,7 +186,7 @@ class TestMultiGPUModel(test.TestCase): if not check_if_compatible_devices(gpus=gpus): return - with self.test_session(): + with self.cached_session(): inputs = keras.Input((4, 3)) init_state = keras.Input((3,)) outputs = keras.layers.SimpleRNN( |