def METHOD_NAME(self, pred, label):
    # print("---dygraph----pred, label:",pred, label)
    cost = paddle.nn.functional.log_loss(
        input=pred, label=paddle.cast(
            label, dtype="float32"))
    avg_cost = paddle.mean(x=cost)
    # add l2_loss.............
    # print("---dygraph-----cost,avg_cost----",cost,avg_cost)
    return avg_cost