    def reorder_encoder_out(self, encoder_out, new_order):
        """Reorder encoder output according to new_order."""
        for key in self.encoders:
            encoder_out[key] = self.encoders[key].reorder_encoder_out(
                encoder_out[key], new_order
            )
        return encoder_out
Reorder encoder output according to new_order.
fairseq/models/composite_encoder.py