examples/legacy/seq2seq/utils.py/Seq2SeqDataCollator/_shift_right_t5
class Seq2SeqDataCollator:    def _shift_right_t5(self, input_ids):
        # shift inputs to the right
        shifted_input_ids = input_ids.new_zeros(input_ids.shape)
        shifted_input_ids[..., 1:] = input_ids[..., :-1].clone()
        shifted_input_ids[..., 0] = self.pad_token_id
        return shifted_input_ids