src/transformers/models/blip/modeling_blip.py/BlipForQuestionAnswering/_shift_right
class BlipForQuestionAnswering:    def _shift_right(self, input_ids):
        pad_token_id = self.decoder_pad_token_id

        shifted_input_ids = input_ids.new_zeros(input_ids.shape)
        shifted_input_ids[..., 1:] = input_ids[..., :-1].clone()
        shifted_input_ids[..., 0] = self.decoder_start_token_id

        # replace possible -100 values in labels by `pad_token_id`
        shifted_input_ids.masked_fill_(shifted_input_ids == -100, pad_token_id)

        return shifted_input_ids