MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _get_trainable_state

Method _get_trainable_state

tensorflow/python/keras/engine/base_layer.py:2184–2196  ·  view source on GitHub ↗

Get the `trainable` state of each sublayer. Returns: A dict mapping all sublayers to their `trainable` value.

(self)

Source from the content-addressed store, hash-verified

2182 return nest.map_structure(_make_placeholder_like, output_shapes)
2183
2184 def _get_trainable_state(self):
2185 """Get the `trainable` state of each sublayer.
2186
2187 Returns:
2188 A dict mapping all sublayers to their `trainable` value.
2189 """
2190 layers = trackable_layer_utils.filter_empty_layer_containers(self._layers)
2191 # Keep track of each top-level layers' `trainable` as well as the
2192 # state of all of its sublayers.
2193 trainable_state = {self: self.trainable}
2194 for layer in layers:
2195 trainable_state.update(layer._get_trainable_state())
2196 return trainable_state
2197
2198 def _set_trainable_state(self, trainable_state):
2199 """Set `trainable` state for each sublayer."""

Callers 4

_process_single_batchFunction · 0.80
compileMethod · 0.80
_make_train_functionMethod · 0.80
_make_train_functionMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected