

"""simple docstring"""

import unittest
from timeit import timeit



def 			SCREAMING_SNAKE_CASE       (   lowercase__				,				lowercase__      ) ->	int:
 lowerCAmelCase__      :							str    =							first_num if first_num >= second_num else second_num
 lowerCAmelCase__      :							Union[str, Any]    =							max_num
 while (common_mult % first_num > 0) or (common_mult % second_num > 0):
  common_mult += max_num
 return common_mult



def 			SCREAMING_SNAKE_CASE       (   lowercase__				,				lowercase__      ) ->	int:
 return b if a == 0 else greatest_common_divisor(b % a				,				lowercase__      )



def 			SCREAMING_SNAKE_CASE       (   lowercase__				,				lowercase__      ) ->	int:
 return first_num // greatest_common_divisor(lowercase__				,				lowercase__      ) * second_num



def 			SCREAMING_SNAKE_CASE       (   ) ->	List[str]:
 lowerCAmelCase__      :							int    =							(
     "from __main__ import least_common_multiple_slow, least_common_multiple_fast"
 )
 print(
     "least_common_multiple_slow():"				,				timeit("least_common_multiple_slow(1000, 999)"				,				setup=lowercase__      )				,				)
 print(
     "least_common_multiple_fast():"				,				timeit("least_common_multiple_fast(1000, 999)"				,				setup=lowercase__      )				,				)






class  __a				(	unittest.TestCase					):





       """simple docstring"""


       __UpperCamelCase				:			Tuple          =	(
           (10, 20),
           (13, 15),
           (4, 31),
           (10, 42),
           (43, 34),
           (5, 12),
           (12, 25),
           (10, 25),
           (6, 9),
       )
       __UpperCamelCase				:			Tuple          =	(20, 195, 124, 210, 1462, 60, 300, 50, 18)






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        for i, (first_num, second_num) in enumerate(self.test_inputs      ):
         lowerCAmelCase__      :							str    =							least_common_multiple_slow(snake_case ,				snake_case      )
         lowerCAmelCase__      :							Tuple    =							least_common_multiple_fast(snake_case ,				snake_case      )
         with self.subTest(i=snake_case      ):
          self.assertEqual(snake_case ,				self.expected_results[i]      )
          self.assertEqual(snake_case ,				self.expected_results[i]      )


if __name__ == "__main__":
    benchmark()
    unittest.main()









"""simple docstring"""

import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest






class  __a				(	__magic_name__					):





       """simple docstring"""


       __UpperCamelCase				:			Optional[int]          =	(VQDiffusionScheduler,)






       def  SCREAMING_SNAKE_CASE_  (      self ,				**snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							str    =							{
            "num_vec_classes": 4_097,
            "num_train_timesteps": 100,
        }

        config.update(**snake_case      )
        return config






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

        lowerCAmelCase__      :							Optional[int]    =							4
        lowerCAmelCase__      :							Optional[Any]    =							8
        lowerCAmelCase__      :							Union[str, Any]    =							8

        lowerCAmelCase__      :							Optional[Any]    =							torch.randint(0 ,				snake_case ,				(batch_size, height * width)      )

        return sample






       @property
       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        assert False






       def  SCREAMING_SNAKE_CASE_  (      self ,				snake_case      ):





        """simple docstring"""

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

        return model






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        for timesteps in [2, 5, 100, 1_000]:
         self.check_over_configs(num_train_timesteps=snake_case      )






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        for num_vec_classes in [5, 100, 1_000, 4_000]:
         self.check_over_configs(num_vec_classes=snake_case      )






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

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






       def  SCREAMING_SNAKE_CASE_  (      self      ):





        """simple docstring"""

        pass






