
import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest

class     _SCREAMING_SNAKE_CASE							(		snake_case							):
				lowerCamelCase_       =     (VQDiffusionScheduler,)





				def        _UpperCAmelCase						(		self :		Union[str, Any]					,      **snake_case_ :		Optional[int]							):


								"""simple docstring"""

								A     :  int   =				{
								    '''num_vec_classes''': 4097,
								    '''num_train_timesteps''': 100,
								}

								config.update(**snake_case_							)
								return config





				def        _UpperCAmelCase						(		self :		Any					,      snake_case_ :		str							):


								"""simple docstring"""

								A     :  List[Any]   =				4
								A     :  Any   =				8
								A     :  str   =				8

								A     :  Optional[int]   =				torch.randint(0					,      snake_case_					,      (batch_size, height * width)							)

								return sample





				@property
				def        _UpperCAmelCase						(		self :		Union[str, Any]							):


								"""simple docstring"""

								assert False





				def        _UpperCAmelCase						(		self :		int					,      snake_case_ :		List[str]							):


								"""simple docstring"""

								def model(snake_case_ :		Union[str, Any]					,      snake_case_ :		Any					,      *snake_case_ :		Dict							):
												A ,       A     :  List[Any]   =				sample.shape
												A     :  Union[str, Any]   =				torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)							)
												A     :  Optional[int]   =				F.log_softmax(logits.double()					,      dim=1							).float()
												return return_value

								return model





				def        _UpperCAmelCase						(		self :		str							):


								"""simple docstring"""

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





				def        _UpperCAmelCase						(		self :		List[Any]							):


								"""simple docstring"""

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





				def        _UpperCAmelCase						(		self :		Dict							):


								"""simple docstring"""

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






				def        _UpperCAmelCase						(		self :		str							):


								"""simple docstring"""

								pass

def 							_lowerCamelCase			(					lowerCamelCase_:  int		):



				'''simple docstring'''







				if not isinstance(lowerCamelCase_				,	lowerCamelCase_		):
								raise ValueError('''double_factorial() only accepts integral values'''		)
				if num < 0:
								raise ValueError('''double_factorial() not defined for negative values'''		)
				A     :  int   =				1
				for i in range(lowerCamelCase_				,	0				,	-2		):
								value *= i
				return value


if __name__ == "__main__":
					import doctest

					doctest.testmod()