




import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__UpperCamelCase      : Tuple					      =   logging.get_logger(__name__)

class 	__lowerCAmelCase			(			__magic_name__				):
       UpperCamelCase__        =						'''speech-encoder-decoder'''
       UpperCamelCase__        =						True
       def __init__(		self		:Dict	,   **__magic_name__		:List[str]       ):







        '''simple docstring'''







        super().__init__(**__magic_name__       )
        if "encoder" not in kwargs or "decoder" not in kwargs:
         raise ValueError(
             F'A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'
             F' `decoder` sub-configurations are passed, but only {kwargs}'       )

        a		       =							kwargs.pop("""encoder"""       )
        a		       =							encoder_config.pop("""model_type"""       )
        a		       =							kwargs.pop("""decoder"""       )
        a		       =							decoder_config.pop("""model_type"""       )

        a		       =							AutoConfig.for_model(__magic_name__	,   **__magic_name__       )
        a		       =							AutoConfig.for_model(__magic_name__	,   **__magic_name__       )
        a		       =							True
       @classmethod
       def    lowerCamelCase__							(		cls		:Union[str, Any]	,   __magic_name__		:PretrainedConfig	,   __magic_name__		:PretrainedConfig	,   **__magic_name__		:Optional[Any]       ):







        '''simple docstring'''







        logger.info("""Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config"""       )
        a		       =							True
        a		       =							True

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





       def    lowerCamelCase__							(		self		:str       ):







        '''simple docstring'''







        a		       =							copy.deepcopy(self.__dict__       )
        a		       =							self.encoder.to_dict()
        a		       =							self.decoder.to_dict()
        a		       =							self.__class__.model_type
        return output







import doctest

import projectq
from projectq.ops import H, Measure





def 	__A	(			__lowerCamelCase					)   -> int:
	a		       =							quantum_engine.allocate_qubit()
	H | qubit
	Measure | qubit
	return int(__lowerCamelCase					)


if __name__ == "__main__":
		doctest.testmod()

		# initialises a new quantum backend
		__UpperCamelCase      : List[Any]					      =   projectq.MainEngine()

		# Generate a list of 10 random numbers
		__UpperCamelCase      : Optional[int]					      =   [get_random_number(quantum_engine) for _ in range(10)]

		# Flushes the quantum engine from memory
		quantum_engine.flush()

		print("Random numbers", random_numbers_list)

