






import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest
class   UpperCamelCase			(					snake_case__			):







		"""simple docstring"""



		snake_case			 = (VQDiffusionScheduler,)
		def    A(	self		:							Optional[int]    ,**_SCREAMING_SNAKE_CASE		:							int		)     -> Optional[int]:


						'''simple docstring'''
						A									=   {
						    'num_vec_classes': 4_0_9_7,
						    'num_train_timesteps': 1_0_0,
						}

						config.update(**_SCREAMING_SNAKE_CASE		)
						return config
		def    A(	self		:							Dict    ,_SCREAMING_SNAKE_CASE		:							Union[str, Any]		)     -> Any:


						'''simple docstring'''
						A									=   4
						A									=   8
						A									=   8

						A									=   torch.randint(0    ,_SCREAMING_SNAKE_CASE    ,(batch_size, height * width)		)

						return sample
		@property
		def    A(	self		:							Dict		)     -> str:


						'''simple docstring'''
						assert False
		def    A(	self		:							Union[str, Any]    ,_SCREAMING_SNAKE_CASE		:							List[Any]		)     -> Any:


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

						return model
		def    A(	self		:							List[str]		)     -> Tuple:


						'''simple docstring'''
						for timesteps in [2, 5, 1_0_0, 1_0_0_0]:
										self.check_over_configs(num_train_timesteps=_SCREAMING_SNAKE_CASE		)
		def    A(	self		:							int		)     -> str:


						'''simple docstring'''
						for num_vec_classes in [5, 1_0_0, 1_0_0_0, 4_0_0_0]:
										self.check_over_configs(num_vec_classes=_SCREAMING_SNAKE_CASE		)
		def    A(	self		:							Tuple		)     -> List[Any]:


						'''simple docstring'''
						for t in [0, 5_0, 9_9]:
										self.check_over_forward(time_step=_SCREAMING_SNAKE_CASE		)







		def    A(	self		:							str		)     -> str:


						'''simple docstring'''
						pass













import numpy as np







def   snake_case		(				UpperCAmelCase						:							Any ):
				A									=   np.exp(UpperCAmelCase )

				# Add up the all the exponentials
				A									=   np.sum(UpperCAmelCase )

				# Divide every exponent by the sum of all exponents
				A									=   exponent_vector / sum_of_exponents

				return softmax_vector


if __name__ == "__main__":
					print(softmax((0,)))





