code: def test_enable_disable_gradient_checkpointing(self):
      if not self.model_class._supports_gradient_checkpointing:
          return  # Skip test if model does not support gradient checkpointing
  
      init_dict, _ = self.prepare_init_args_and_inputs_for_common()
  
      # at init model should have gradient checkpointing disabled
      model = self.model_class(**init_dict)
      self.assertFalse(model.is_gradient_checkpointing)
  
      # check enable works
      model.enable_gradient_checkpointing()
      self.assertTrue(model.is_gradient_checkpointing)
  
      # check disable works
      model.disable_gradient_checkpointing()
      self.assertFalse(model.is_gradient_checkpointing)
  
imports: import inspect
  import tempfile
  import traceback
  import unittest
  import unittest.mock
  import uuid
  from typing import Dict, List, Tuple
  import numpy
  import requests_mock
  import torch
  from huggingface_hub import delete_repo
  from requests.exceptions import HTTPError
  from diffusers.models import UNet2DConditionModel
  from diffusers.models.attention_processor import AttnProcessor, AttnProcessor2_0, XFormersAttnProcessor
  from diffusers.training_utils import EMAModel
  from diffusers.utils import is_xformers_available, logging
  from diffusers.utils.testing_utils import CaptureLogger, require_python39_or_higher, require_torch_2, require_torch_accelerator_with_training, require_torch_gpu, run_test_in_subprocess, torch_device
  from ..others.test_utils import TOKEN, USER, is_staging_test
label_desc: Use image node_id 14 for calling the ModelTesterMixin obj's underlying member method code with example usage: obj.test_enable_disable_gradient_checkpointing() without return types