


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..clip.configuration_clip import CLIPVisionConfig


lowercase_           =	logging.get_logger(__name__)


class        A_					(       __UpperCamelCase    ):




      '''simple docstring'''


      __snake_case					       =   """vision-text-dual-encoder"""
      __snake_case					       =   True




      def __init__(				self:       int						,      a:       Optional[Any]=512						,      a:       List[Any]=2.6_5_9_2						,      **a:       Dict				):
       super().__init__(**a				)

       if "vision_config" not in kwargs:
        raise ValueError('`vision_config` can not be `None`.'				)

       if "text_config" not in kwargs:
        raise ValueError('`text_config` can not be `None`.'				)

       __lowerCamelCase		:							Any							=						kwargs.pop('vision_config'				)
       __lowerCamelCase		:							Union[str, Any]							=						kwargs.pop('text_config'				)

       __lowerCamelCase		:							Tuple							=						vision_config.pop('model_type'				)
       __lowerCamelCase		:							List[Any]							=						text_config.pop('model_type'				)

       if vision_model_type == "clip":
        __lowerCamelCase		:							Optional[Any]							=						AutoConfig.for_model(a						,      **a				).vision_config
       elif vision_model_type == "clip_vision_model":
        __lowerCamelCase		:							Any							=						CLIPVisionConfig(**a				)
       else:
        __lowerCamelCase		:							Dict							=						AutoConfig.for_model(a						,      **a				)

       __lowerCamelCase		:							List[str]							=						AutoConfig.for_model(a						,      **a				)

       __lowerCamelCase		:							Union[str, Any]							=						projection_dim
       __lowerCamelCase		:							List[Any]							=						logit_scale_init_value




      @classmethod
      def      _snake_case	(				cls:       List[Any]						,      a:       PretrainedConfig						,      a:       PretrainedConfig						,      **a:       Optional[Any]				):
       return cls(vision_config=vision_config.to_dict()						,      text_config=text_config.to_dict()						,      **a				)




      def      _snake_case	(				self:       str				):
       __lowerCamelCase		:							Union[str, Any]							=						copy.deepcopy(self.__dict__				)
       __lowerCamelCase		:							List[str]							=						self.vision_config.to_dict()
       __lowerCamelCase		:							List[Any]							=						self.text_config.to_dict()
       __lowerCamelCase		:							Optional[Any]							=						self.__class__.model_type
       return output





import doctest

import projectq
from projectq.ops import H, Measure
def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__						):
 __lowerCamelCase		:							int							=						quantum_engine.allocate_qubit()
 H | qubit
 Measure | qubit
 return int(SCREAMING_SNAKE_CASE__						)


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

       # initialises a new quantum backend
       lowercase_           =	projectq.MainEngine()

       # Generate a list of 10 random numbers
       lowercase_           =	[get_random_number(quantum_engine) for _ in range(1_0)]

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

       print('Random numbers', random_numbers_list)

