mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Adds eager compatability message for PartitionedVariable.
PiperOrigin-RevId: 173772851
This commit is contained in:
parent
e7645b6295
commit
0eba15fe63
|
|
@ -1053,7 +1053,16 @@ class Variable(object):
|
||||||
|
|
||||||
|
|
||||||
class PartitionedVariable(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):
|
class PartitionedVariableIterator(object):
|
||||||
"""An iterator that allows accessing the underlying `Variable` objects.
|
"""An iterator that allows accessing the underlying `Variable` objects.
|
||||||
|
|
@ -1102,10 +1111,11 @@ class PartitionedVariable(object):
|
||||||
`partitions` is not a list.
|
`partitions` is not a list.
|
||||||
ValueError: If `variable_list` is empty, or the `Variable` shape
|
ValueError: If `variable_list` is empty, or the `Variable` shape
|
||||||
information does not match `shape`, or `partitions` has invalid values.
|
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():
|
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)):
|
if not isinstance(variable_list, (list, tuple)):
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
"variable_list is not a list or tuple: %s" % variable_list)
|
"variable_list is not a list or tuple: %s" % variable_list)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user