def METHOD_NAME(self):
    # build dictionary
    self.d = test_utils.dummy_dictionary(3)
    vocab = len(self.d)
    self.assertEqual(vocab, 4 + 3)  # 4 special + 3 tokens
    self.assertEqual(self.d.pad(), 1)
    self.assertEqual(self.d.eos(), 2)
    self.assertEqual(self.d.unk(), 3)
    pad, eos, unk, w1, w2, w3 = 1, 2, 3, 4, 5, 6  # noqa: F841
    # build dataset
    self.data = [
        # the first batch item has padding
        {
            "source": torch.LongTensor([w1, eos]),
            "target": torch.LongTensor([w1, eos]),
        },
        {
            "source": torch.LongTensor([w1, eos]),
            "target": torch.LongTensor([w1, w1, eos]),
        },
    ]
    self.sample = next(test_utils.dummy_dataloader(self.data))
    # build model
    self.args = argparse.Namespace()
    self.args.sentence_avg = False
    self.args.report_accuracy = False
    self.args.probs = (
        torch.FloatTensor(
            [
                #      pad   eos  unk   w1   w2   w3
                [0.05, 0.05, 0.1, 0.05, 0.3, 0.4, 0.05],
                [0.05, 0.10, 0.2, 0.05, 0.2, 0.3, 0.10],
                [0.05, 0.15, 0.3, 0.05, 0.1, 0.2, 0.15],
            ]
        )
        .unsqueeze(0)
        .expand(2, 3, 7)
    )  # add batch dimension
    self.task = test_utils.TestTranslationTask.setup_task(self.args, self.d, self.d)
    self.model = self.task.build_model(self.args)