aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/distribute/python/values.py
diff options
context:
space:
mode:
authorGravatar Pavithra Vijay <psv@google.com>2018-08-24 16:36:39 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-24 16:41:28 -0700
commit2bc4f495f7bf315356dc61d45a22222933c9a49e (patch)
treeeff79bd3e21af6bf329b57672bdc717a86e6d973 /tensorflow/contrib/distribute/python/values.py
parent58615322fd1fcdfffc78f1f57e284549f6f6ed6c (diff)
Fix error when getting optimizer variables with distribution strategy
- add `_in_graph_mode` property to DistributedVariable PiperOrigin-RevId: 210177702
Diffstat (limited to 'tensorflow/contrib/distribute/python/values.py')
-rw-r--r--tensorflow/contrib/distribute/python/values.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/distribute/python/values.py b/tensorflow/contrib/distribute/python/values.py
index e73d9c193e..3ccaa2690e 100644
--- a/tensorflow/contrib/distribute/python/values.py
+++ b/tensorflow/contrib/distribute/python/values.py
@@ -304,6 +304,10 @@ class DistributedVariable(DistributedDelegate):
self._primary_var.op.type)
return self.get().op
+ @property
+ def _in_graph_mode(self):
+ return self._primary_var._in_graph_mode # pylint: disable=protected-access
+
def read_value(self):
return distribution_strategy_context.get_distribution_strategy().read_var(
self)