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

def pop(self):

    if (not self.layers):
        raise TypeError('There    are    no    layers    in    the    model.')
    self.layers.pop()
    if (not self.layers):
        self.outputs = []
        self.inbound_nodes = []
        self.outbound_nodes = []
    else:
        self.layers[(-1)].outbound_nodes = []
        self.outputs = [self.layers[(-1)].output]
        self.inbound_nodes[0].output_tensors = self.outputs
        self.inbound_nodes[0].output_shapes = [self.outputs[0]._keras_shape]
    self.built = False
