def METHOD_NAME(self, model, net_output, sample):
    lprobs, target = self.get_lprobs_and_target(model, net_output, sample)
    mask = target.ne(self.padding_idx)
    n_correct = torch.sum(
        lprobs.argmax(1).masked_select(mask).eq(target.masked_select(mask))
    )
    total = torch.sum(mask)
    return n_correct, total