def METHOD_NAME(self):
    self.args.label_smoothing = 0.1
    crit = LabelSmoothedCrossEntropyCriterion.build_criterion(self.args, self.task)
    loss, _, logging_output = crit(self.model, self.sample)
    def get_one_no_padding(idx):
        # create a new sample with just a single batch item so that there's
        # no padding
        sample1 = next(test_utils.dummy_dataloader([self.data[idx]]))
        args1 = copy.copy(self.args)
        args1.probs = args1.probs[idx, :, :].unsqueeze(0)
        model1 = self.task.build_model(args1)
        loss1, _, _ = crit(model1, sample1)
        return loss1
    loss1 = get_one_no_padding(0)
    loss2 = get_one_no_padding(1)
    self.assertAlmostEqual(loss, loss1 + loss2)