src/transformers/generation_beam_search.py/BeamScorer/finalize
class BeamScorer:    def finalize(
        self,
        input_ids: torch.LongTensor,
        next_scores: torch.FloatTensor,
        next_tokens: torch.LongTensor,
        next_indices: torch.LongTensor,
        max_length: int,
        **kwargs
    ) -> torch.LongTensor:
        raise NotImplementedError("This is an abstract method.")