From 0eba15fe6349ae2bd50b14496a1f283f462b0c66 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Sat, 28 Oct 2017 08:30:04 -0700 Subject: [PATCH] Adds eager compatability message for PartitionedVariable. PiperOrigin-RevId: 173772851 --- tensorflow/python/ops/variables.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tensorflow/python/ops/variables.py b/tensorflow/python/ops/variables.py index fd0aee3c333..187aa5d8e04 100644 --- a/tensorflow/python/ops/variables.py +++ b/tensorflow/python/ops/variables.py @@ -1053,7 +1053,16 @@ class Variable(object): class PartitionedVariable(object): - """A container for partitioned `Variable` objects.""" + """A container for partitioned `Variable` objects. + + @compatiblity(eager) `tf.PartitionedVariable` is not compatible with + eager execution. Use `tfe.Variable` instead which is compatable + with both eager execution and graph construction. See [the + TensorFlow Eager Execution + guide](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/eager/python/g3doc/guide.md#variables-and-optimizers) + for details on how variables work in eager execution. + @end_compatiblity + """ class PartitionedVariableIterator(object): """An iterator that allows accessing the underlying `Variable` objects. @@ -1102,10 +1111,11 @@ class PartitionedVariable(object): `partitions` is not a list. ValueError: If `variable_list` is empty, or the `Variable` shape information does not match `shape`, or `partitions` has invalid values. - RuntimeError: If created in EAGER mode. + RuntimeError: If eager execution is enabled """ if not context.in_graph_mode(): - raise RuntimeError("PartitionedVariable not supported in Eager mode.") + raise RuntimeError("tf.PartitionedVariable not supported in " + "eager mode. Please use tfe.Variable instead") if not isinstance(variable_list, (list, tuple)): raise TypeError( "variable_list is not a list or tuple: %s" % variable_list)