aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/keras
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-24 11:28:07 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-24 11:37:28 -0700
commit28eeda839f124cf5ba648576e86214b38141e4ab (patch)
treeab662878c5af9b531fab0592148c716740d1c750 /tensorflow/python/keras
parent5fbb064ba1e78bb28f7adbe92e6583c3b2bdfda7 (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.py2
-rw-r--r--tensorflow/python/keras/utils/multi_gpu_utils_test.py2
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(