tf.contrib.checkpoint.List

Class List

Maintains checkpoint dependencies on its contents (which must also be
checkpointable), and forwards any Layer metadata such as updates and losses.

Note that List is purely a container. It lets a tf.keras.Model or
other checkpointable object know about its contents, but does not call any
Layer instances which are added to it. To indicate a sequence of Layer
instances which should be called sequentially, use tf.keras.Sequential.

This kind of wrapping is necessary because Checkpointable objects do not
(yet) deeply inspect regular Python data structures, so for example assigning
a regular list (self.layer_list = [layers.Dense(3)]) does not create a
checkpoint dependency and does not add the Layer instance's weights to its
parent Model.

__init__

__init__(
*args,
**kwargs
)

Construct a new sequence. Arguments are passed to list().

Properties

layers

losses

Aggregate losses from any Layer instances.

non_trainable_variables

non_trainable_weights

trainable_variables

trainable_weights

updates

Aggregate updates from any Layer instances.

variables

weights

Methods

__add__

__add__(other)

__contains__

__contains__(value)

__deepcopy__

__deepcopy__(memo)

__eq__

__eq__(other)

Return self==value.

__getitem__

__getitem__(key)

__iadd__

__iadd__(values)

__iter__

__iter__()

__len__

__len__()

__radd__

__radd__(other)

__reversed__

__reversed__()

__subclasshook__

__subclasshook__(
cls,
C
)

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.subclasscheck().
It should return True, False or NotImplemented. If it returns
NotImplemented, the normal algorithm is used. Otherwise, it
overrides the normal algorithm (and the outcome is cached).

append

append(value)

Add a new checkpointable value.

count

count(value)

S.count(value) -> integer -- return number of occurrences of value

extend

extend(values)

Add a sequence of checkpointable values.

index

index(
value,
start=0,
stop=None
)

S.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.