'Call the loss function.
Args:
prediction_tensor: a tensor representing predicted quantities.
target_tensor: a tensor representing regression or classification targets.
ignore_nan_targets: whether to ignore nan targets in the loss computation.
E.g. can be used if the target tensor is missing groundtruth data that
shouldn\'t be factored into the loss.
scope: Op scope name. Defaults to \'Loss\' if None.
**params: Additional keyword arguments for specific implementations of
the Loss.
Returns:
loss: a tensor representing the value of the loss function.'

def __call__(self, prediction_tensor, target_tensor, ignore_nan_targets=False, scope=None, **params):

    with tf.name_scope(scope, 'Loss', [prediction_tensor, target_tensor, params]) as scope:
        if ignore_nan_targets:
            target_tensor = tf.where(tf.is_nan(target_tensor), prediction_tensor, target_tensor)
        return self._compute_loss(prediction_tensor, target_tensor, **params)
