"""simple docstring"""




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 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  int  							=						DownBlockaD  # noqa F405
						lowerCAmelCase__     :  Any  							=						'down'





						def  snake_case__		(				self   )    -> int:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Optional[int]  							=						ResnetDownsampleBlockaD  # noqa F405
						lowerCAmelCase__     :  str  							=						'down'





						def  snake_case__		(				self   )    -> Optional[int]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						AttnDownBlockaD  # noqa F405
						lowerCAmelCase__     :  int  							=						'down'





						def  snake_case__		(				self   )    -> Optional[int]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						CrossAttnDownBlockaD  # noqa F405
						lowerCAmelCase__     :  Optional[int]  							=						'down'





						def  snake_case__		(				self   )    -> List[Any]:
													A__		   =							super().prepare_init_args_and_inputs_for_common()
													A__		   =							32
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Dict:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Optional[Any]  							=						SimpleCrossAttnDownBlockaD  # noqa F405
						lowerCAmelCase__     :  Any  							=						'down'





						@property
						def  snake_case__		(				self   )    -> Optional[Any]:
													return super().get_dummy_input(include_encoder_hidden_states=lowercase_   )





						def  snake_case__		(				self   )    -> List[Any]:
													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  snake_case__		(				self   )    -> List[str]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						SkipDownBlockaD  # noqa F405
						lowerCAmelCase__     :  str  							=						'down'





						@property
						def  snake_case__		(				self   )    -> str:
													return super().get_dummy_input(include_skip_sample=lowercase_   )





						def  snake_case__		(				self   )    -> Tuple:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  List[Any]  							=						AttnSkipDownBlockaD  # noqa F405
						lowerCAmelCase__     :  str  							=						'down'





						@property
						def  snake_case__		(				self   )    -> List[Any]:
													return super().get_dummy_input(include_skip_sample=lowercase_   )





						def  snake_case__		(				self   )    -> Any:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Any  							=						DownEncoderBlockaD  # noqa F405
						lowerCAmelCase__     :  List[str]  							=						'down'





						@property
						def  snake_case__		(				self   )    -> Optional[int]:
													return super().get_dummy_input(include_temb=lowercase_   )





						def  snake_case__		(				self   )    -> int:
													A__		   =							{
													    'in_channels': 32,
													    'out_channels': 32,
													}
													A__		   =							self.dummy_input
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Optional[Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  List[Any]  							=						AttnDownEncoderBlockaD  # noqa F405
						lowerCAmelCase__     :  List[str]  							=						'down'





						@property
						def  snake_case__		(				self   )    -> Any:
													return super().get_dummy_input(include_temb=lowercase_   )





						def  snake_case__		(				self   )    -> int:
													A__		   =							{
													    'in_channels': 32,
													    'out_channels': 32,
													}
													A__		   =							self.dummy_input
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> List[str]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Dict  							=						UNetMidBlockaD  # noqa F405
						lowerCAmelCase__     :  Optional[int]  							=						'mid'





						def  snake_case__		(				self   )    -> Optional[Any]:
													A__		   =							{
													    'in_channels': 32,
													    'temb_channels': 1_28,
													}
													A__		   =							self.dummy_input
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Tuple:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						UNetMidBlockaDCrossAttn  # noqa F405
						lowerCAmelCase__     :  Tuple  							=						'mid'





						def  snake_case__		(				self   )    -> Union[str, Any]:
													A__		   =							super().prepare_init_args_and_inputs_for_common()
													A__		   =							32
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Union[str, Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						UNetMidBlockaDSimpleCrossAttn  # noqa F405
						lowerCAmelCase__     :  str  							=						'mid'





						@property
						def  snake_case__		(				self   )    -> List[Any]:
													return super().get_dummy_input(include_encoder_hidden_states=lowercase_   )





						def  snake_case__		(				self   )    -> Tuple:
													A__		   =							super().prepare_init_args_and_inputs_for_common()
													A__		   =							32
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Union[str, Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						UpBlockaD  # noqa F405
						lowerCAmelCase__     :  Optional[int]  							=						'up'





						@property
						def  snake_case__		(				self   )    -> str:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						def  snake_case__		(				self   )    -> Tuple:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  str  							=						ResnetUpsampleBlockaD  # noqa F405
						lowerCAmelCase__     :  Tuple  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Dict:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						def  snake_case__		(				self   )    -> List[Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Any  							=						CrossAttnUpBlockaD  # noqa F405
						lowerCAmelCase__     :  int  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Optional[Any]:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						def  snake_case__		(				self   )    -> Union[str, Any]:
													A__		   =							super().prepare_init_args_and_inputs_for_common()
													A__		   =							32
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Dict:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Optional[Any]  							=						SimpleCrossAttnUpBlockaD  # noqa F405
						lowerCAmelCase__     :  List[str]  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Optional[Any]:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_						,include_encoder_hidden_states=lowercase_   )





						def  snake_case__		(				self   )    -> Dict:
													A__		   =							super().prepare_init_args_and_inputs_for_common()
													A__		   =							32
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Optional[Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  List[Any]  							=						AttnUpBlockaD  # noqa F405
						lowerCAmelCase__     :  Any  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Optional[Any]:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						@unittest.skipIf(torch_device == 'mps'						,'MPS result is not consistent'   )
						def  snake_case__		(				self   )    -> List[str]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Union[str, Any]  							=						SkipUpBlockaD  # noqa F405
						lowerCAmelCase__     :  Any  							=						'up'





						@property
						def  snake_case__		(				self   )    -> int:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						def  snake_case__		(				self   )    -> List[Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Dict  							=						AttnSkipUpBlockaD  # noqa F405
						lowerCAmelCase__     :  List[Any]  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Optional[Any]:
													return super().get_dummy_input(include_res_hidden_states_tuple=lowercase_   )





						def  snake_case__		(				self   )    -> Union[str, Any]:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  Tuple  							=						UpDecoderBlockaD  # noqa F405
						lowerCAmelCase__     :  int  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Union[str, Any]:
													return super().get_dummy_input(include_temb=lowercase_   )





						def  snake_case__		(				self   )    -> Optional[int]:
													A__		   =							{'in_channels': 32, 'out_channels': 32}

													A__		   =							self.dummy_input
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Dict:
													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(lowercase_   )






class 			UpperCamelCase__(	UpperCamelCase_						,  unittest.TestCase       ):
						lowerCAmelCase__     :  int  							=						AttnUpDecoderBlockaD  # noqa F405
						lowerCAmelCase__     :  Union[str, Any]  							=						'up'





						@property
						def  snake_case__		(				self   )    -> Tuple:
													return super().get_dummy_input(include_temb=lowercase_   )





						def  snake_case__		(				self   )    -> str:
													A__		   =							{'in_channels': 32, 'out_channels': 32}

													A__		   =							self.dummy_input
													return init_dict, inputs_dict





						def  snake_case__		(				self   )    -> Any:
													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(lowercase_   )









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


lowerCamelCase											=       logging.get_logger(__name__)

lowerCamelCase											=       {
    'transfo-xl-wt103': 'https://huggingface.co/transfo-xl-wt103/resolve/main/config.json',
}




class A  (   UpperCamelCase_     ):
      UpperCamelCase__							:  Dict      ='transfo-xl'
      UpperCamelCase__							:  int      =['mems']
      UpperCamelCase__							:  List[str]      ={
          'n_token': 'vocab_size',
          'hidden_size': 'd_model',
          'num_attention_heads': 'n_head',
          'num_hidden_layers': 'n_layer',
      }






      def __init__(					self						:     Tuple			,   lowercase_						:     List[Any]=26_7735			,   lowercase_						:     List[Any]=[2_0000, 4_0000, 20_0000]			,   lowercase_						:     Tuple=1024			,   lowercase_						:     Optional[int]=1024			,   lowercase_						:     str=16			,   lowercase_						:     int=64			,   lowercase_						:     Any=4096			,   lowercase_						:     List[Any]=4			,   lowercase_						:     List[Any]=False			,   lowercase_						:     List[str]=18			,   lowercase_						:     Tuple=1600			,   lowercase_						:     List[str]=1000			,   lowercase_						:     Any=True			,   lowercase_						:     str=True			,   lowercase_						:     Optional[int]=0			,   lowercase_						:     List[Any]=-1			,   lowercase_						:     Optional[int]=True			,   lowercase_						:     Any=0.1			,   lowercase_						:     Tuple=0.0			,   lowercase_						:     str=True			,   lowercase_						:     Union[str, Any]="normal"			,   lowercase_						:     Dict=0.01			,   lowercase_						:     Optional[Any]=0.01			,   lowercase_						:     List[Any]=0.02			,   lowercase_						:     List[Any]=1E-5			,   lowercase_						:     Tuple=0			,   **lowercase_						:     Tuple			,   )					->						Dict:
             """simple docstring"""




             _lowerCamelCase       :		Optional[Any]		=vocab_size
             _lowerCamelCase       :		Optional[Any]		=[]
             self.cutoffs.extend(lowercase_ )
             if proj_share_all_but_first:
                    _lowerCamelCase       :		List[str]		=[False] + [True] * len(self.cutoffs )
             else:
                    _lowerCamelCase       :		str		=[False] + [False] * len(self.cutoffs )
             _lowerCamelCase       :		str		=d_model
             _lowerCamelCase       :		str		=d_embed
             _lowerCamelCase       :		str		=d_head
             _lowerCamelCase       :		Dict		=d_inner
             _lowerCamelCase       :		Union[str, Any]		=div_val
             _lowerCamelCase       :		Dict		=pre_lnorm
             _lowerCamelCase       :		Tuple		=n_layer
             _lowerCamelCase       :		Optional[Any]		=n_head
             _lowerCamelCase       :		List[Any]		=mem_len
             _lowerCamelCase       :		List[Any]		=same_length
             _lowerCamelCase       :		Optional[int]		=attn_type
             _lowerCamelCase       :		List[str]		=clamp_len
             _lowerCamelCase       :		int		=sample_softmax
             _lowerCamelCase       :		List[Any]		=adaptive
             _lowerCamelCase       :		List[str]		=dropout
             _lowerCamelCase       :		Any		=dropatt
             _lowerCamelCase       :		Dict		=untie_r
             _lowerCamelCase       :		List[Any]		=init
             _lowerCamelCase       :		List[str]		=init_range
             _lowerCamelCase       :		int		=proj_init_std
             _lowerCamelCase       :		Optional[int]		=init_std
             _lowerCamelCase       :		Tuple		=layer_norm_epsilon
             super().__init__(eos_token_id=lowercase_			,   **lowercase_ )






      @property
      def        lowerCamelCase       (					self						:     List[str] )					->						Dict:
             """simple docstring"""




             logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.''' )
             return -1






      @max_position_embeddings.setter
      def        lowerCamelCase       (					self						:     int			,   lowercase_						:     int )					->						List[str]:
             """simple docstring"""




             raise NotImplementedError(
                 F'''The model {self.model_type} is one of the few models that has no sequence length limit.''' )


