


import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest


class        __lowerCamelCase      (				lowerCamelCase_ ):


				"""simple docstring"""







				a_:		Tuple					      =	(VQDiffusionScheduler,)






				def        lowerCAmelCase__			(				self     :    Optional[int]	,							**lowerCamelCase_     :    List[Any]					):
								_lowerCAmelCase  						={
								    """num_vec_classes""": 4097,
								    """num_train_timesteps""": 100,
								}

								config.update(**lowerCamelCase_					)
								return config






				def        lowerCAmelCase__			(				self     :    Optional[Any]	,							lowerCamelCase_     :    int					):
								_lowerCAmelCase  						=4
								_lowerCAmelCase  						=8
								_lowerCAmelCase  						=8

								_lowerCAmelCase  						=torch.randint(0	,							lowerCamelCase_	,							(batch_size, height * width)					)

								return sample






				@property
				def        lowerCAmelCase__			(				self     :    Any					):
								assert False






				def        lowerCAmelCase__			(				self     :    str	,							lowerCamelCase_     :    Dict					):
								def model(lowerCamelCase_     :    str	,							lowerCamelCase_     :    List[Any]	,							*lowerCamelCase_     :    List[Any]					):
												_lowerCAmelCase						,							_lowerCAmelCase  						=sample.shape
												_lowerCAmelCase  						=torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)					)
												_lowerCAmelCase  						=F.log_softmax(logits.double()	,							dim=1					).float()
												return return_value

								return model






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






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






				def        lowerCAmelCase__			(				self     :    Union[str, Any]					):
								for t in [0, 50, 99]:
												self.check_over_forward(time_step=lowerCamelCase_					)






				def        lowerCAmelCase__			(				self     :    Optional[int]					):
								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

