

"""simple docstring"""




import copy

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


SCREAMING_SNAKE_CASE_     :			Dict	  =			logging.get_logger(__name__)


class 		_A       (			__a					):
      __a								=	'encoder-decoder'
      __a								=	True





      def __init__(  self    ,						**SCREAMING_SNAKE_CASE__		)   ->					Optional[int]:
         super().__init__(**SCREAMING_SNAKE_CASE__		)
         assert (
             "encoder" in kwargs and "decoder" in kwargs
         ), "Config has to be initialized with encoder and decoder config"
         lowerCamelCase__						=			kwargs.pop("encoder"		)
         lowerCamelCase__						=			encoder_config.pop("model_type"		)
         lowerCamelCase__						=			kwargs.pop("decoder"		)
         lowerCamelCase__						=			decoder_config.pop("model_type"		)

         from ..auto.configuration_auto import AutoConfig

         lowerCamelCase__						=			AutoConfig.for_model(SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)
         lowerCamelCase__						=			AutoConfig.for_model(SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)
         lowerCamelCase__						=			True





      @classmethod
      def 					_lowerCamelCase  (  cls    ,						SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__    ,						**SCREAMING_SNAKE_CASE__		)   ->					PretrainedConfig:
         logger.info("Set `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"		)
         lowerCamelCase__						=			True
         lowerCamelCase__						=			True

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





      def 					_lowerCamelCase  (  self		)   ->					int:
         lowerCamelCase__						=			copy.deepcopy(self.__dict__		)
         lowerCamelCase__						=			self.encoder.to_dict()
         lowerCamelCase__						=			self.decoder.to_dict()
         lowerCamelCase__						=			self.__class__.model_type
         return output







"""simple docstring"""




import numpy as np



def 	UpperCAmelCase__   (				A__   )      ->      np.array:




   """simple docstring"""
   return 1 / (1 + np.exp(-vector   ))


if __name__ == "__main__":
     import doctest

     doctest.testmod()




