def METHOD_NAME(self, model, tokens, mask):
    logits, _ = model(src_tokens=self.get_masked_input(tokens, mask))
    lprobs = F.log_softmax(logits, dim=-1, dtype=torch.float)
    scores = lprobs.gather(2, tokens.unsqueeze(-1)).squeeze(-1)
    mask = mask.type_as(scores)
    scores = (scores * mask).sum(dim=-1) / mask.sum(dim=-1)
    return scores