





import unittest

from diffusers.models.unet_ad_blocks import *  # noqa F403
from diffusers.utils import torch_device

from .test_unet_blocks_common import UNetBlockTesterMixin


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Optional[Any]							     =       DownBlockaD  # noqa F405
			__lowerCamelCase      :			List[str]							     =       '''down'''






			def   a_			(     self  :       Optional[int]  )      ->      Optional[Any]:







					"""simple docstring"""






					A__     =  [-0.0_2_3_2, -0.9_8_6_9, 0.8_0_5_4, -0.0_6_3_7, -0.1_6_8_8, -1.4_2_6_4, 0.4_4_7_0, -1.3_3_9_4, 0.0_9_0_4]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			List[Any]							     =       ResnetDownsampleBlockaD  # noqa F405
			__lowerCamelCase      :			Any							     =       '''down'''






			def   a_			(     self  :       Union[str, Any]  )      ->      List[str]:







					"""simple docstring"""






					A__     =  [0.0_7_1_0, 0.2_4_1_0, -0.7_3_2_0, -1.0_7_5_7, -1.1_3_4_3, 0.3_5_4_0, -0.0_1_3_3, -0.2_5_7_6, 0.0_9_4_8]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Tuple							     =       AttnDownBlockaD  # noqa F405
			__lowerCamelCase      :			Optional[int]							     =       '''down'''






			def   a_			(     self  :       List[Any]  )      ->      Union[str, Any]:







					"""simple docstring"""






					A__     =  [0.0_6_3_6, 0.8_9_6_4, -0.6_2_3_4, -1.0_1_3_1, 0.0_8_4_4, 0.4_9_3_5, 0.3_4_3_7, 0.0_9_1_1, -0.2_9_5_7]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Optional[int]							     =       CrossAttnDownBlockaD  # noqa F405
			__lowerCamelCase      :			Dict							     =       '''down'''






			def   a_			(     self  :       Optional[Any]  )      ->      str:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			def   a_			(     self  :       Dict  )      ->      Any:







					"""simple docstring"""






					A__     =  [0.2_2_3_8, -0.7_3_9_6, -0.2_2_5_5, -0.3_8_2_9, 0.1_9_2_5, 1.1_6_6_5, 0.0_6_0_3, -0.7_2_9_5, 0.1_9_8_3]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			int							     =       SimpleCrossAttnDownBlockaD  # noqa F405
			__lowerCamelCase      :			int							     =       '''down'''






			@property
			def   a_			(     self  :       Any  )      ->      Any:







					"""simple docstring"""






					return super().get_dummy_input(include_encoder_hidden_states=__lowerCAmelCase  )






			def   a_			(     self  :       List[str]  )      ->      Dict:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			@unittest.skipIf(torch_device == """mps"""				,      """MPS result is not consistent"""  )
			def   a_			(     self  :       Any  )      ->      Dict:







					"""simple docstring"""






					A__     =  [0.7_9_2_1, -0.0_9_9_2, -0.1_9_6_2, -0.7_6_9_5, -0.4_2_4_2, 0.7_8_0_4, 0.4_7_3_7, 0.2_7_6_5, 0.3_3_3_8]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Any							     =       SkipDownBlockaD  # noqa F405
			__lowerCamelCase      :			List[Any]							     =       '''down'''






			@property
			def   a_			(     self  :       str  )      ->      Dict:







					"""simple docstring"""






					return super().get_dummy_input(include_skip_sample=__lowerCAmelCase  )







			def   a_			(     self  :       List[Any]  )      ->      Optional[int]:







					"""simple docstring"""






					A__     =  [-0.0_8_4_5, -0.2_0_8_7, -0.2_4_6_5, 0.0_9_7_1, 0.1_9_0_0, -0.0_4_8_4, 0.2_6_6_4, 0.4_1_7_9, 0.5_0_6_9]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			str							     =       AttnSkipDownBlockaD  # noqa F405
			__lowerCamelCase      :			str							     =       '''down'''






			@property
			def   a_			(     self  :       Dict  )      ->      Union[str, Any]:







					"""simple docstring"""






					return super().get_dummy_input(include_skip_sample=__lowerCAmelCase  )







			def   a_			(     self  :       Optional[Any]  )      ->      Tuple:







					"""simple docstring"""






					A__     =  [0.5_5_3_9, 0.1_6_0_9, 0.4_9_2_4, 0.0_5_3_7, -0.1_9_9_5, 0.4_0_5_0, 0.0_9_7_9, -0.2_7_2_1, -0.0_6_4_2]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			List[str]							     =       DownEncoderBlockaD  # noqa F405
			__lowerCamelCase      :			Union[str, Any]							     =       '''down'''






			@property
			def   a_			(     self  :       Optional[int]  )      ->      Optional[Any]:







					"""simple docstring"""






					return super().get_dummy_input(include_temb=__lowerCAmelCase  )






			def   a_			(     self  :       str  )      ->      Optional[int]:







					"""simple docstring"""






					A__     =  {
					    """in_channels""": 32,
					    """out_channels""": 32,
					}
					A__     =  self.dummy_input
					return init_dict, inputs_dict







			def   a_			(     self  :       str  )      ->      Any:







					"""simple docstring"""






					A__     =  [1.1_1_0_2, 0.5_3_0_2, 0.4_8_7_2, -0.0_0_2_3, -0.8_0_4_2, 0.0_4_8_3, -0.3_4_8_9, -0.5_6_3_2, 0.7_6_2_6]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Tuple							     =       AttnDownEncoderBlockaD  # noqa F405
			__lowerCamelCase      :			List[str]							     =       '''down'''






			@property
			def   a_			(     self  :       Union[str, Any]  )      ->      Union[str, Any]:







					"""simple docstring"""






					return super().get_dummy_input(include_temb=__lowerCAmelCase  )






			def   a_			(     self  :       Any  )      ->      Any:







					"""simple docstring"""






					A__     =  {
					    """in_channels""": 32,
					    """out_channels""": 32,
					}
					A__     =  self.dummy_input
					return init_dict, inputs_dict







			def   a_			(     self  :       Dict  )      ->      int:







					"""simple docstring"""






					A__     =  [0.8_9_6_6, -0.1_4_8_6, 0.8_5_6_8, 0.8_1_4_1, -0.9_0_4_6, -0.1_3_4_2, -0.0_9_7_2, -0.7_4_1_7, 0.1_5_3_8]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Dict							     =       UNetMidBlockaD  # noqa F405
			__lowerCamelCase      :			Dict							     =       '''mid'''






			def   a_			(     self  :       Optional[int]  )      ->      Optional[Any]:







					"""simple docstring"""






					A__     =  {
					    """in_channels""": 32,
					    """temb_channels""": 1_28,
					}
					A__     =  self.dummy_input
					return init_dict, inputs_dict







			def   a_			(     self  :       Optional[Any]  )      ->      Optional[Any]:







					"""simple docstring"""






					A__     =  [-0.1_0_6_2, 1.7_2_4_8, 0.3_4_9_4, 1.4_5_6_9, -0.0_9_1_0, -1.2_4_2_1, -0.9_9_8_4, 0.6_7_3_6, 1.0_0_2_8]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Tuple							     =       UNetMidBlockaDCrossAttn  # noqa F405
			__lowerCamelCase      :			Optional[int]							     =       '''mid'''






			def   a_			(     self  :       List[str]  )      ->      str:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			def   a_			(     self  :       List[Any]  )      ->      str:







					"""simple docstring"""






					A__     =  [0.0_1_8_7, 2.4_2_2_0, 0.4_4_8_4, 1.1_2_0_3, -0.6_1_2_1, -1.5_1_2_2, -0.8_2_7_0, 0.7_8_5_1, 1.8_3_3_5]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Dict							     =       UNetMidBlockaDSimpleCrossAttn  # noqa F405
			__lowerCamelCase      :			Tuple							     =       '''mid'''






			@property
			def   a_			(     self  :       int  )      ->      Optional[int]:







					"""simple docstring"""






					return super().get_dummy_input(include_encoder_hidden_states=__lowerCAmelCase  )






			def   a_			(     self  :       Optional[int]  )      ->      Optional[Any]:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			def   a_			(     self  :       Dict  )      ->      List[Any]:







					"""simple docstring"""






					A__     =  [0.7_1_4_3, 1.9_9_7_4, 0.5_4_4_8, 1.3_9_7_7, 0.1_2_8_2, -1.1_2_3_7, -1.4_2_3_8, 0.5_5_3_0, 0.8_8_8_0]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			str							     =       UpBlockaD  # noqa F405
			__lowerCamelCase      :			List[str]							     =       '''up'''






			@property
			def   a_			(     self  :       str  )      ->      List[str]:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )







			def   a_			(     self  :       Dict  )      ->      str:







					"""simple docstring"""






					A__     =  [-0.2_0_4_1, -0.4_1_6_5, -0.3_0_2_2, 0.0_0_4_1, -0.6_6_2_8, -0.7_0_5_3, 0.1_9_2_8, -0.0_3_2_5, 0.0_5_2_3]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Any							     =       ResnetUpsampleBlockaD  # noqa F405
			__lowerCamelCase      :			Optional[int]							     =       '''up'''






			@property
			def   a_			(     self  :       Optional[Any]  )      ->      Dict:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )







			def   a_			(     self  :       Optional[Any]  )      ->      Any:







					"""simple docstring"""






					A__     =  [0.2_2_8_7, 0.3_5_4_9, -0.1_3_4_6, 0.4_7_9_7, -0.1_7_1_5, -0.9_6_4_9, 0.7_3_0_5, -0.5_8_6_4, -0.6_2_4_4]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Optional[int]							     =       CrossAttnUpBlockaD  # noqa F405
			__lowerCamelCase      :			Dict							     =       '''up'''






			@property
			def   a_			(     self  :       Union[str, Any]  )      ->      Tuple:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )






			def   a_			(     self  :       List[Any]  )      ->      List[str]:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			def   a_			(     self  :       str  )      ->      Tuple:







					"""simple docstring"""






					A__     =  [-0.1_4_0_3, -0.3_5_1_5, -0.0_4_2_0, -0.1_4_2_5, 0.3_1_6_7, 0.5_0_9_4, -0.2_1_8_1, 0.5_9_3_1, 0.5_5_8_2]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Optional[Any]							     =       SimpleCrossAttnUpBlockaD  # noqa F405
			__lowerCamelCase      :			List[str]							     =       '''up'''






			@property
			def   a_			(     self  :       int  )      ->      Any:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase				,      include_encoder_hidden_states=__lowerCAmelCase  )






			def   a_			(     self  :       Optional[int]  )      ->      str:







					"""simple docstring"""






					A__ ,     A__     =  super().prepare_init_args_and_inputs_for_common()
					A__     =  32
					return init_dict, inputs_dict







			def   a_			(     self  :       Any  )      ->      List[Any]:







					"""simple docstring"""






					A__     =  [0.2_6_4_5, 0.1_4_8_0, 0.0_9_0_9, 0.8_0_4_4, -0.9_7_5_8, -0.9_0_8_3, 0.0_9_9_4, -1.1_4_5_3, -0.7_4_0_2]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			List[str]							     =       AttnUpBlockaD  # noqa F405
			__lowerCamelCase      :			Optional[int]							     =       '''up'''






			@property
			def   a_			(     self  :       Any  )      ->      int:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )







			@unittest.skipIf(torch_device == """mps"""				,      """MPS result is not consistent"""  )
			def   a_			(     self  :       Any  )      ->      Any:







					"""simple docstring"""






					A__     =  [0.0_9_7_9, 0.1_3_2_6, 0.0_0_2_1, 0.0_6_5_9, 0.2_2_4_9, 0.0_0_5_9, 0.1_1_3_2, 0.5_9_5_2, 0.1_0_3_3]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Dict							     =       SkipUpBlockaD  # noqa F405
			__lowerCamelCase      :			Optional[Any]							     =       '''up'''






			@property
			def   a_			(     self  :       Tuple  )      ->      str:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )







			def   a_			(     self  :       str  )      ->      Optional[Any]:







					"""simple docstring"""






					A__     =  [-0.0_8_9_3, -0.1_2_3_4, -0.1_5_0_6, -0.0_3_3_2, 0.0_1_2_3, -0.0_2_1_1, 0.0_5_6_6, 0.0_1_4_3, 0.0_3_6_2]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			List[str]							     =       AttnSkipUpBlockaD  # noqa F405
			__lowerCamelCase      :			List[Any]							     =       '''up'''






			@property
			def   a_			(     self  :       List[str]  )      ->      Dict:







					"""simple docstring"""






					return super().get_dummy_input(include_res_hidden_states_tuple=__lowerCAmelCase  )







			def   a_			(     self  :       int  )      ->      Tuple:







					"""simple docstring"""






					A__     =  [0.0_3_6_1, 0.0_6_1_7, 0.2_7_8_7, -0.0_3_5_0, 0.0_3_4_2, 0.3_4_2_1, -0.0_8_4_3, 0.0_9_1_3, 0.3_0_1_5]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Union[str, Any]							     =       UpDecoderBlockaD  # noqa F405
			__lowerCamelCase      :			str							     =       '''up'''






			@property
			def   a_			(     self  :       Optional[int]  )      ->      Optional[int]:







					"""simple docstring"""






					return super().get_dummy_input(include_temb=__lowerCAmelCase  )






			def   a_			(     self  :       Union[str, Any]  )      ->      List[Any]:







					"""simple docstring"""






					A__     =  {"""in_channels""": 32, """out_channels""": 32}

					A__     =  self.dummy_input
					return init_dict, inputs_dict







			def   a_			(     self  :       List[str]  )      ->      Optional[Any]:







					"""simple docstring"""






					A__     =  [0.4_4_0_4, 0.1_9_9_8, -0.9_8_8_6, -0.3_3_2_0, -0.3_1_2_8, -0.7_0_3_4, -0.6_9_5_5, -0.2_3_3_8, -0.3_1_3_7]
					super().test_output(__lowerCAmelCase  )


class     A     (SCREAMING_SNAKE_CASE  ,	unittest.TestCase       ):
			'''simple docstring'''




			__lowerCamelCase      :			Dict							     =       AttnUpDecoderBlockaD  # noqa F405
			__lowerCamelCase      :			List[str]							     =       '''up'''






			@property
			def   a_			(     self  :       Any  )      ->      Optional[Any]:







					"""simple docstring"""






					return super().get_dummy_input(include_temb=__lowerCAmelCase  )






			def   a_			(     self  :       Optional[int]  )      ->      Dict:







					"""simple docstring"""






					A__     =  {"""in_channels""": 32, """out_channels""": 32}

					A__     =  self.dummy_input
					return init_dict, inputs_dict







			def   a_			(     self  :       int  )      ->      str:







					"""simple docstring"""






					A__     =  [0.6_7_3_8, 0.4_4_9_1, 0.1_0_5_5, 1.0_7_1_0, 0.7_3_1_6, 0.3_3_3_9, 0.3_3_5_2, 0.1_0_2_3, 0.3_5_6_8]
					super().test_output(__lowerCAmelCase  )










from ...configuration_utils import PretrainedConfig
from ...utils import logging


A       :   Optional[int]					= logging.get_logger(__name__)

A       :   Dict					= {
    '''vinvino02/glpn-kitti''': '''https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json''',
    # See all GLPN models at https://huggingface.co/models?filter=glpn
}


class     A     (SCREAMING_SNAKE_CASE       ):
			'''simple docstring'''




			__lowerCamelCase      :			Tuple							     =       '''glpn'''






			def __init__(     self  :       Optional[int]				,      __lowerCAmelCase  :       Union[str, Any]=3				,      __lowerCAmelCase  :       Any=4				,      __lowerCAmelCase  :       Tuple=[2, 2, 2, 2]				,      __lowerCAmelCase  :       int=[8, 4, 2, 1]				,      __lowerCAmelCase  :       int=[32, 64, 1_60, 2_56]				,      __lowerCAmelCase  :       str=[7, 3, 3, 3]				,      __lowerCAmelCase  :       Dict=[4, 2, 2, 2]				,      __lowerCAmelCase  :       List[str]=[1, 2, 5, 8]				,      __lowerCAmelCase  :       List[Any]=[4, 4, 4, 4]				,      __lowerCAmelCase  :       str="gelu"				,      __lowerCAmelCase  :       Union[str, Any]=0.0				,      __lowerCAmelCase  :       Tuple=0.0				,      __lowerCAmelCase  :       List[Any]=0.0_2				,      __lowerCAmelCase  :       Dict=0.1				,      __lowerCAmelCase  :       Dict=1e-6				,      __lowerCAmelCase  :       Tuple=64				,      __lowerCAmelCase  :       Tuple=10				,      __lowerCAmelCase  :       Union[str, Any]=-1				,      **__lowerCAmelCase  :       Any				,      )      ->      Tuple:







					"""simple docstring"""






					super().__init__(**__lowerCAmelCase  )

					A__     =  num_channels
					A__     =  num_encoder_blocks
					A__     =  depths
					A__     =  sr_ratios
					A__     =  hidden_sizes
					A__     =  patch_sizes
					A__     =  strides
					A__     =  mlp_ratios
					A__     =  num_attention_heads
					A__     =  hidden_act
					A__     =  hidden_dropout_prob
					A__     =  attention_probs_dropout_prob
					A__     =  initializer_range
					A__     =  drop_path_rate
					A__     =  layer_norm_eps
					A__     =  decoder_hidden_size
					A__     =  max_depth
					A__     =  head_in_index



