






'''simple docstring'''

import copy

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


UpperCAmelCase__						:Optional[Any]          =			logging.get_logger(__name__)







class 	SCREAMING_SNAKE_CASE	(      lowerCAmelCase_  ):
       snake_case__    :     str   		=			'encoder-decoder'
       snake_case__    :     Tuple   		=			True




       def __init__(					self      : int	,    **A__      : Optional[int]					):


            """simple docstring"""







            super().__init__(**A__					)
            assert (
                "encoder" in kwargs and "decoder" in kwargs
            ), "Config has to be initialized with encoder and decoder config"
            __lowerCamelCase						:       Optional[Any]				   =				kwargs.pop("""encoder"""					)
            __lowerCamelCase						:       List[str]				   =				encoder_config.pop("""model_type"""					)
            __lowerCamelCase						:       List[Any]				   =				kwargs.pop("""decoder"""					)
            __lowerCamelCase						:       Dict				   =				decoder_config.pop("""model_type"""					)

            from ..auto.configuration_auto import AutoConfig

            __lowerCamelCase						:       Tuple				   =				AutoConfig.for_model(A__	,    **A__					)
            __lowerCamelCase						:       str				   =				AutoConfig.for_model(A__	,    **A__					)
            __lowerCamelCase						:       List[str]				   =				True




       @classmethod
       def 					a_					(					cls      : int	,    A__      : PretrainedConfig	,    A__      : PretrainedConfig	,    **A__      : Optional[Any]					):


            """simple docstring"""







            logger.info("""Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"""					)
            __lowerCamelCase						:       str				   =				True
            __lowerCamelCase						:       str				   =				True

            return cls(encoder=encoder_config.to_dict()	,    decoder=decoder_config.to_dict()	,    **A__					)




       def 					a_					(					self      : List[Any]					):


            """simple docstring"""







            __lowerCamelCase						:       Optional[int]				   =				copy.deepcopy(self.__dict__					)
            __lowerCamelCase						:       List[Any]				   =				self.encoder.to_dict()
            __lowerCamelCase						:       Dict				   =				self.decoder.to_dict()
            __lowerCamelCase						:       Optional[int]				   =				self.__class__.model_type
            return output











'''simple docstring'''

from ..utils import DummyObject, requires_backends







class 	SCREAMING_SNAKE_CASE	(      metaclass=lowerCAmelCase_  ):
       snake_case__    :     Union[str, Any]   		=			['torch', 'torchsde']




       def __init__(					self      : int	,    *A__      : Optional[Any]	,    **A__      : Dict					):


            """simple docstring"""







            requires_backends(self	,    ["""torch""", """torchsde"""]					)




       @classmethod
       def 					a_					(					cls      : Optional[Any]	,    *A__      : str	,    **A__      : Optional[Any]					):


            """simple docstring"""







            requires_backends(cls	,    ["""torch""", """torchsde"""]					)




       @classmethod
       def 					a_					(					cls      : Union[str, Any]	,    *A__      : Any	,    **A__      : Union[str, Any]					):


            """simple docstring"""







            requires_backends(cls	,    ["""torch""", """torchsde"""]					)



