




import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest







class __snake_case     (     a						):
   UpperCAmelCase__    :       Union[str, Any]		=    (VQDiffusionScheduler,)







   def lowerCamelCase		( self						:		str   ,		**_snake_case						:		Optional[Any]):

        """simple docstring"""


        UpperCAmelCase_		=				{
            '''num_vec_classes''': 4097,
            '''num_train_timesteps''': 100,
        }

        config.update(**_snake_case)
        return config







   def lowerCamelCase		( self						:		List[str]   ,		_snake_case						:		str):

        """simple docstring"""


        UpperCAmelCase_		=				4
        UpperCAmelCase_		=				8
        UpperCAmelCase_		=				8

        UpperCAmelCase_		=				torch.randint(0   ,		_snake_case   ,		(batch_size, height * width))

        return sample







   @property
   def lowerCamelCase		( self						:		int):

        """simple docstring"""


        assert False







   def lowerCamelCase		( self						:		int   ,		_snake_case						:		Dict):

        """simple docstring"""


        def model(_snake_case						:		Dict   ,		_snake_case						:		int   ,		*_snake_case						:		int):
             UpperCAmelCase_	,			UpperCAmelCase_		=				sample.shape
             UpperCAmelCase_		=				torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels))
             UpperCAmelCase_		=				F.log_softmax(logits.double()   ,		dim=1).float()
             return return_value

        return model







   def lowerCamelCase		( self						:		Dict):

        """simple docstring"""


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







   def lowerCamelCase		( self						:		List[Any]):

        """simple docstring"""


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







   def lowerCamelCase		( self						:		List[str]):

        """simple docstring"""


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







   def lowerCamelCase		( self						:		Union[str, Any]):

        """simple docstring"""


        pass












import math


def   A		(__A  :       int			)  -> float:







     """simple docstring"""


     UpperCAmelCase_		=				math.log(2  ,							10			) * number
     UpperCAmelCase_		=				round((log_number - int(__A			))  ,							15			)

     return difference


def   A		(__A  :       int = 678910			)  -> int:







     """simple docstring"""


     UpperCAmelCase_		=				90
     UpperCAmelCase_		=				0

     UpperCAmelCase_		=				math.log(1.23  ,							10			)
     UpperCAmelCase_		=				math.log(1.24  ,							10			)
     UpperCAmelCase_		=				0

     while position < number:
          UpperCAmelCase_		=				log_difference(__A			)

          if difference >= upper_limit:
               power_iterator += 93

          elif difference < lower_limit:
               power_iterator += 196

          else:
               UpperCAmelCase_		=				power_iterator
               power_iterator += 196
               position += 1

     return previous_power


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    print(f"{solution() = }")






