




'''simple docstring'''





import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest




class      UpperCamelCase       (	lowerCamelCase_       ):
  a     :Tuple          =					(VQDiffusionScheduler,)



  def     a_							(			self		,     **__lowerCAmelCase ):







      '''simple docstring'''


      _a				:							str							       =      {
          """num_vec_classes""": 4097,
          """num_train_timesteps""": 100,
      }

      config.update(**lowerCamelCase_ )
      return config



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      _a				:							Dict							       =      4
      _a				:							Any							       =      8
      _a				:							Optional[Any]							       =      8

      _a				:							Union[str, Any]							       =      torch.randint(0		,     lowerCamelCase_		,     (batch_size, height * width) )

      return sample



  @property
  def     a_							(			self ):







      '''simple docstring'''


      assert False



  def     a_							(			self		,     __lowerCAmelCase ):







      '''simple docstring'''


      def model(__lowerCAmelCase		,     __lowerCAmelCase		,     *__lowerCAmelCase ):
          _a       , _a				:							Tuple							       =      sample.shape
          _a				:							Union[str, Any]							       =      torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels) )
          _a				:							Union[str, Any]							       =      F.log_softmax(logits.double()		,     dim=1 ).float()
          return return_value

      return model



  def     a_							(			self ):







      '''simple docstring'''


      for timesteps in [2, 5, 100, 1000]:
          self.check_over_configs(num_train_timesteps=lowerCamelCase_ )



  def     a_							(			self ):







      '''simple docstring'''


      for num_vec_classes in [5, 100, 1000, 4000]:
          self.check_over_configs(num_vec_classes=lowerCamelCase_ )



  def     a_							(			self ):







      '''simple docstring'''


      for t in [0, 50, 99]:
          self.check_over_forward(time_step=lowerCamelCase_ )



  def     a_							(			self ):







      '''simple docstring'''


      pass






def 		snake_case_   (				lowercase__     :    str     ):






				'''simple docstring'''






				_lowerCAmelCase  						=53_81
				for x in s:
								_lowerCAmelCase  						=((hash_value << 5) + hash_value) + ord(lowercase__     )
				return hash_value & 0Xffff_ffff

