Loosen return type for variables.
PiperOrigin-RevId: 229924537
This commit is contained in:
parent
faad607b60
commit
f9f39e43c8
@ -199,23 +199,23 @@ class Module(six.with_metaclass(ModuleMetaclass, tracking.AutoCheckpointable)):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def variables(self):
|
def variables(self):
|
||||||
"""Returns a tuple of variables owned by this module and it's submodules.
|
"""Collection of variables owned by this module and it's submodules.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tuple of variables for the current module (sorted by attribute name)
|
A collection of variables for the current module (sorted by attribute
|
||||||
followed by variables from all submodules recursively (depth first).
|
name) followed by variables from all submodules recursively (depth first).
|
||||||
"""
|
"""
|
||||||
return tuple(walk(self, recurse_if=_IS_MODULE, predicate=_IS_VARIABLE))
|
return tuple(walk(self, recurse_if=_IS_MODULE, predicate=_IS_VARIABLE))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def owned_variables(self):
|
def owned_variables(self):
|
||||||
"""Returns a tuple of variables that are attributes of the current module.
|
"""Collection of variables that are attributes of the current module.
|
||||||
|
|
||||||
See `variables` for a property which returns all variables from the current
|
See `variables` for a property which returns all variables from the current
|
||||||
module and all it's submodules recursively.
|
module and all it's submodules recursively.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tuple of variables which are attributes of the current module. Will
|
A collection of variables which are attributes of the current module. Will
|
||||||
yield variables inside nested structures (lists etc) but not in other
|
yield variables inside nested structures (lists etc) but not in other
|
||||||
modules.
|
modules.
|
||||||
"""
|
"""
|
||||||
@ -223,24 +223,24 @@ class Module(six.with_metaclass(ModuleMetaclass, tracking.AutoCheckpointable)):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def trainable_variables(self):
|
def trainable_variables(self):
|
||||||
"""Returns a tuple of variables owned by this module and it's submodules.
|
"""Collection of variables owned by this module and it's submodules.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tuple of variables for the current module (sorted by attribute name)
|
A collection of variables for the current module (sorted by attribute
|
||||||
followed by variables from all submodules recursively (depth first).
|
name) followed by variables from all submodules recursively (depth first).
|
||||||
"""
|
"""
|
||||||
return tuple(
|
return tuple(
|
||||||
walk(self, recurse_if=_IS_MODULE, predicate=_IS_TRAINABLE_VARIABLE))
|
walk(self, recurse_if=_IS_MODULE, predicate=_IS_TRAINABLE_VARIABLE))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def owned_trainable_variables(self):
|
def owned_trainable_variables(self):
|
||||||
"""Returns a tuple of variables that are attributes of the current module.
|
"""Collection of variables that are attributes of the current module.
|
||||||
|
|
||||||
See `variables` for a property which returns all variables from the current
|
See `variables` for a property which returns all variables from the current
|
||||||
module and all it's submodules recursively.
|
module and all it's submodules recursively.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A tuple of variables which are attributes of the current module. Will
|
A collection of variables which are attributes of the current module. Will
|
||||||
yield variables inside nested structures (lists etc) but not in other
|
yield variables inside nested structures (lists etc) but not in other
|
||||||
modules.
|
modules.
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user