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

Method pop

tensorflow/python/keras/engine/sequential.py:218–237  ·  view source on GitHub ↗

Removes the last layer in the model. Raises: TypeError: if there are no layers in the model.

(self)

Source from the content-addressed store, hash-verified

216
217 @trackable.no_automatic_dependency_tracking
218 def pop(self):
219 """Removes the last layer in the model.
220
221 Raises:
222 TypeError: if there are no layers in the model.
223 """
224 if not self.layers:
225 raise TypeError('There are no layers in the model.')
226
227 layer = self._layers.pop()
228 self._layer_call_argspecs.pop(layer)
229 if not self.layers:
230 self.outputs = None
231 self.inputs = None
232 self.built = False
233 elif self._is_graph_network:
234 self.layers[-1]._outbound_nodes = []
235 self.outputs = [self.layers[-1].output]
236 self._init_graph_network(self.inputs, self.outputs, name=self.name)
237 self.built = True
238
239 @base_layer_utils.default
240 def build(self, input_shape=None):

Callers 15

test_sequential_popMethod · 0.95
_checkMethod · 0.45
_testBothMethod · 0.45
_test_optimizerMethod · 0.45
clear_sessionFunction · 0.45
dotFunction · 0.45
__init__Method · 0.45
__init__Method · 0.45
_configure_embeddingsMethod · 0.45

Calls 1

_init_graph_networkMethod · 0.80

Tested by 11

test_sequential_popMethod · 0.76
_checkMethod · 0.36
_testBothMethod · 0.36
_test_optimizerMethod · 0.36
__init__Method · 0.36
topological_sortFunction · 0.36