src/transformers/models/gptsan_japanese/modeling_gptsan_japanese.py/GPTSanJapanesePreTrainedModel/_set_gradient_checkpointing
class GPTSanJapanesePreTrainedModel:    def _set_gradient_checkpointing(self, module, value=False):
        if isinstance(module, (GPTSanJapaneseAttention,)):
            module.gradient_checkpointing = value