aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/keras/backend.py
diff options
context:
space:
mode:
authorGravatar Pavithra Vijay <psv@google.com>2018-08-22 15:09:08 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-22 15:21:16 -0700
commitd97e525c1fa601b4b1b0a3cffd9e579201d167ef (patch)
tree4ea8d86943b547c5f0fc37165d3d2a7753ff9aee /tensorflow/python/keras/backend.py
parentcd199a89dbffdd55aa2fc89acb874763382f196d (diff)
Switch to using variable._in_graph_mode instead of context.executing_eagerly() in optimizer.variables()
Remove global collection usage from the Keras model to estimator flow. PiperOrigin-RevId: 209837803
Diffstat (limited to 'tensorflow/python/keras/backend.py')
-rw-r--r--tensorflow/python/keras/backend.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tensorflow/python/keras/backend.py b/tensorflow/python/keras/backend.py
index 62433a400b..b52ab7f05c 100644
--- a/tensorflow/python/keras/backend.py
+++ b/tensorflow/python/keras/backend.py
@@ -696,10 +696,9 @@ def _get_variables(graph=None):
return variables
-def _initialize_variables(session, variables=None):
+def _initialize_variables(session):
"""Utility to initialize uninitialized variables on the fly."""
- if variables is None:
- variables = _get_variables(ops.get_default_graph())
+ variables = _get_variables(ops.get_default_graph())
candidate_vars = []
for v in variables:
if not getattr(v, '_keras_initialized', False):