

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

import numpy as np
import PIL.Image

from diffusers.utils.outputs import BaseOutput


@dataclass
class      lowerCamelCase_ (			_lowerCAmelCase):
 _lowerCAmelCase									=	42



class      lowerCamelCase_ (			unittest.TestCase):




 def     a       (			self							):
   __UpperCAmelCase	:  Any		=     CustomOutput(images=np.random.rand(1  ,  3  ,  4  ,  4							)							)

   # check every way of getting the attribute
   assert isinstance(outputs.images  ,  np.ndarray							)
   assert outputs.images.shape == (1, 3, 4, 4)
   assert isinstance(outputs['images']  ,  np.ndarray							)
   assert outputs["images"].shape == (1, 3, 4, 4)
   assert isinstance(outputs[0]  ,  np.ndarray							)
   assert outputs[0].shape == (1, 3, 4, 4)

   # test with a non-tensor attribute
   __UpperCAmelCase	:  Tuple		=     CustomOutput(images=[PIL.Image.new('RGB'  ,  (4, 4)							)]							)

   # check every way of getting the attribute
   assert isinstance(outputs.images  ,  _UpperCAmelCase							)
   assert isinstance(outputs.images[0]  ,  PIL.Image.Image							)
   assert isinstance(outputs['images']  ,  _UpperCAmelCase							)
   assert isinstance(outputs['images'][0]  ,  PIL.Image.Image							)
   assert isinstance(outputs[0]  ,  _UpperCAmelCase							)
   assert isinstance(outputs[0][0]  ,  PIL.Image.Image							)




 def     a       (			self							):
   # test output reinitialization with a `dict` for compatibility with `accelerate`
   __UpperCAmelCase	:  str		=     CustomOutput({'images': np.random.rand(1  ,  3  ,  4  ,  4							)}							)

   # check every way of getting the attribute
   assert isinstance(outputs.images  ,  np.ndarray							)
   assert outputs.images.shape == (1, 3, 4, 4)
   assert isinstance(outputs['images']  ,  np.ndarray							)
   assert outputs["images"].shape == (1, 3, 4, 4)
   assert isinstance(outputs[0]  ,  np.ndarray							)
   assert outputs[0].shape == (1, 3, 4, 4)

   # test with a non-tensor attribute
   __UpperCAmelCase	:  List[Any]		=     CustomOutput({'images': [PIL.Image.new('RGB'  ,  (4, 4)							)]}							)

   # check every way of getting the attribute
   assert isinstance(outputs.images  ,  _UpperCAmelCase							)
   assert isinstance(outputs.images[0]  ,  PIL.Image.Image							)
   assert isinstance(outputs['images']  ,  _UpperCAmelCase							)
   assert isinstance(outputs['images'][0]  ,  PIL.Image.Image							)
   assert isinstance(outputs[0]  ,  _UpperCAmelCase							)
   assert isinstance(outputs[0][0]  ,  PIL.Image.Image							)








from ..utils import DummyObject, requires_backends


class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)





