def loss2name(loss):
    if hasattr(loss, '__call__'):
        return loss.__name__
    else:
        return loss
def loss2name(loss):
    if hasattr(loss, '__call__'):
        return loss.__name__
    else:
        return loss