def METHOD_NAME(self, loss: torch.Tensor, **moving_averages):
    """
    :param loss:
    :param moving_averages:
    :return: the value of the loss (float)
    """
    loss_val = self.backward_on_loss(loss, **moving_averages)
    if self.optimizer_step():
        return loss_val
    else:
        return None