def METHOD_NAME(self, hypo, pos_probs, normalized=True, lenpen=1.0):
    pos_scores = torch.FloatTensor(pos_probs).log()
    self.assertAlmostEqual(hypo["positional_scores"], pos_scores)
    self.assertEqual(pos_scores.numel(), hypo["tokens"].numel())
    score = pos_scores.sum()
    if normalized:
        score /= pos_scores.numel() ** lenpen
    self.assertLess(abs(score - hypo["score"]), 1e-6)