

import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest


class    SCREAMING_SNAKE_CASE__      (__snake_case  ):
    __lowerCamelCase		: int														=  (VQDiffusionScheduler,)





    def    snake_case_       (   self		,     **a):
         lowercase__					:     Any   = {
             'num_vec_classes': 4097,
             'num_train_timesteps': 100,
         }

         config.update(**a)
         return config





    def    snake_case_       (   self		,     a):
         lowercase__					:     Optional[int]   = 4
         lowercase__					:     Dict   = 8
         lowercase__					:     Union[str, Any]   = 8

         lowercase__					:     str   = torch.randint(0		,     a		,     (batch_size, height * width))

         return sample





    @property
    def    snake_case_       (   self):
         assert False





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

         return model





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





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





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





    def    snake_case_       (   self):
         pass




from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL

from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available


@dataclass
class    SCREAMING_SNAKE_CASE__      (__snake_case  ):
    __lowerCamelCase		: Union[List[PIL.Image.Image], np.ndarray]


if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
       from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
       from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline

