code: 
  
  
  import torch
  import torch.nn.functional as F
  
  from diffusers import VQDiffusionScheduler
  
  from .test_schedulers import SchedulerCommonTest
  
  
  
  
  
  
  
  class 				__SCREAMING_SNAKE_CASE   (			snake_case__   ):
        A				:							List[Any]    							=     (VQDiffusionScheduler,)
  
  
        def        __lowerCamelCase			(							self							,						**SCREAMING_SNAKE_CASE__		):
              lowercase			:   Any					   =		{
                  '''num_vec_classes''': 4097,
                  '''num_train_timesteps''': 100,
              }
  
              config.update(**__snake_case		)
              return config
  
  
        def        __lowerCamelCase			(							self							,						SCREAMING_SNAKE_CASE__		):
              lowercase			:   int					   =		4
              lowercase			:   str					   =		8
              lowercase			:   int					   =		8
  
              lowercase			:   Optional[Any]					   =		torch.randint(0							,						__snake_case							,						(batch_size, height * width)		)
  
              return sample
  
  
        @property
        def        __lowerCamelCase			(							self		):
              assert False
  
  
        def        __lowerCamelCase			(							self							,						SCREAMING_SNAKE_CASE__		):
              def model(SCREAMING_SNAKE_CASE__							,						SCREAMING_SNAKE_CASE__							,						*SCREAMING_SNAKE_CASE__		):
                    lowercase   ,			lowercase			:   Any					   =		sample.shape
                    lowercase			:   str					   =		torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)		)
                    lowercase			:   int					   =		F.log_softmax(logits.double()							,						dim=1		).float()
                    return return_value
  
              return model
  
  
        def        __lowerCamelCase			(							self		):
              for timesteps in [2, 5, 100, 1000]:
                    self.check_over_configs(num_train_timesteps=__snake_case		)
  
  
        def        __lowerCamelCase			(							self		):
              for num_vec_classes in [5, 100, 1000, 4000]:
                    self.check_over_configs(num_vec_classes=__snake_case		)
  
  
        def        __lowerCamelCase			(							self		):
              for t in [0, 50, 99]:
                    self.check_over_forward(time_step=__snake_case		)
  
  
  
  
  
  
        def        __lowerCamelCase			(							self		):
              pass
  
  
style_context: 
  
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      is_torch_available,
      is_transformers_available,
      is_transformers_version,
  )
  
  
  try:
    if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.27.0''')):
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    from ...utils.dummy_torch_and_transformers_objects import (
        AudioLDMPipeline,
    )
  else:
    from .pipeline_audioldm import AudioLDMPipeline
  
  