'Retrieve the model\'s losses.
Will only include losses that are either
inconditional, or conditional on inputs to this model
(e.g. will not include losses that depend on tensors
that aren\'t inputs to this model).
# Returns
A list of loss tensors.'

@property
def losses(self):

    losses = []
    for layer in self.layers:
        if hasattr(layer, 'losses'):
            for (node_index, node) in enumerate(layer.inbound_nodes):
                node_key = ((layer.name + '_ib-') + str(node_index))
                if (node_key in self.container_nodes):
                    inputs = node.input_tensors
                    losses += layer.get_losses_for(inputs)
            losses += layer.get_losses_for(None)
    losses += self.get_losses_for(None)
    return losses
