





import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest

class 			__A(    __UpperCAmelCase			):
     __A							=							(VQDiffusionScheduler,)

     def 						_UpperCamelCase  (   self,							**A   ):





            """simple docstring"""

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

            config.update(**A   )
            return config

     def 						_UpperCamelCase  (   self,							A   ):





            """simple docstring"""

            _UpperCamelCase														=    4
            _UpperCamelCase														=    8
            _UpperCamelCase														=    8

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

            return sample

     @property
     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            assert False

     def 						_UpperCamelCase  (   self,							A   ):





            """simple docstring"""

            def model(A,							A,							*A   ):
                   _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 						_UpperCamelCase  (   self   ):





            """simple docstring"""

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

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

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

     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

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



     def 						_UpperCamelCase  (   self   ):





            """simple docstring"""

            pass








'''simple docstring'''







from ..utils import DummyObject, requires_backends


class       lowerCAmelCase			(					metaclass=__UpperCAmelCase      ):
		a				:       Any							=       ["""torch""", """transformers""", """invisible_watermark"""]




		def __init__(					self       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(self       ,    ["torch", "transformers", "invisible_watermark"]   )




		@classmethod
		def      lowercase							(					cls       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(cls       ,    ["torch", "transformers", "invisible_watermark"]   )




		@classmethod
		def      lowercase							(					cls       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(cls       ,    ["torch", "transformers", "invisible_watermark"]   )


class       lowerCAmelCase			(					metaclass=__UpperCAmelCase      ):
		a				:       Optional[Any]							=       ["""torch""", """transformers""", """invisible_watermark"""]




		def __init__(					self       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(self       ,    ["torch", "transformers", "invisible_watermark"]   )




		@classmethod
		def      lowercase							(					cls       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(cls       ,    ["torch", "transformers", "invisible_watermark"]   )




		@classmethod
		def      lowercase							(					cls       ,    *UpperCamelCase       ,    **UpperCamelCase   ):
								requires_backends(cls       ,    ["torch", "transformers", "invisible_watermark"]   )