src/transformers/generation_utils.py/GenerationMixin/_reorder_cache
class GenerationMixin:    def _reorder_cache(self, past, beam_idx):
        raise NotImplementedError(
            f"Make sure that a `_reorder_cache` function is correctly implemented in {self.__class__.__module__} to enable beam search for {self.__class__}"
        )