src/transformers/models/encoder_decoder/modeling_tf_encoder_decoder.py/TFEncoderDecoderModel/_reorder_cache
class TFEncoderDecoderModel:    def _reorder_cache(self, past, beam_idx):
        # apply decoder cache reordering here
        return self.decoder._reorder_cache(past, beam_idx)