def METHOD_NAME(self, model, net_output, sample, reduce=True):
    lprobs, target = self.get_lprobs_and_target(model, net_output, sample)
    loss, nll_loss = label_smoothed_nll_loss(
        lprobs,
        target,
        self.eps,
        ignore_index=self.padding_idx,
        reduce=reduce,
    )
    return loss, nll_loss