



"""simple docstring"""




import copy

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


a_								=   logging.get_logger(__name__)



class 	__lowerCAmelCase       (		lowerCAmelCase__				):
 lowerCAmelCase__       =					"""vision-text-dual-encoder"""
 lowerCAmelCase__       =					True




 def __init__(  self		,			__UpperCAmelCase=512		,			__UpperCAmelCase=2.6_592		,			**__UpperCAmelCase			):



    '''simple docstring'''
    super().__init__(**__UpperCAmelCase			)

    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  							=      kwargs.pop('''vision_config'''			)
    __lowerCamelCase  							=      kwargs.pop('''text_config'''			)

    __lowerCamelCase  							=      vision_config.pop('''model_type'''			)
    __lowerCamelCase  							=      text_config.pop('''model_type'''			)

    if vision_model_type == "clip":
       __lowerCamelCase  							=      AutoConfig.for_model(__UpperCAmelCase		,			**__UpperCAmelCase			).vision_config
    elif vision_model_type == "clip_vision_model":
       __lowerCamelCase  							=      CLIPVisionConfig(**__UpperCAmelCase			)
    else:
       __lowerCamelCase  							=      AutoConfig.for_model(__UpperCAmelCase		,			**__UpperCAmelCase			)

    __lowerCamelCase  							=      AutoConfig.for_model(__UpperCAmelCase		,			**__UpperCAmelCase			)

    __lowerCamelCase  							=      projection_dim
    __lowerCamelCase  							=      logit_scale_init_value




 @classmethod
 def     lowerCamelCase (  cls		,			__UpperCAmelCase		,			__UpperCAmelCase		,			**__UpperCAmelCase			):



    '''simple docstring'''
    return cls(vision_config=vision_config.to_dict()		,			text_config=text_config.to_dict()		,			**__UpperCAmelCase			)




 def     lowerCamelCase (  self			):



    '''simple docstring'''
    __lowerCamelCase  							=      copy.deepcopy(self.__dict__			)
    __lowerCamelCase  							=      self.vision_config.to_dict()
    __lowerCamelCase  							=      self.text_config.to_dict()
    __lowerCamelCase  							=      self.__class__.model_type
    return output











def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	list	,_UpperCamelCase     :	int	,_UpperCamelCase     :	int							):
   if target == 0:
      answer.append(path.copy()							)
   else:
      for index in range(_UpperCamelCase	,len(_UpperCamelCase							)							):
         if target >= candidates[index]:
            path.append(candidates[index]							)
            backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,target - candidates[index]	,_UpperCamelCase							)
            path.pop(len(_UpperCamelCase							) - 1							)





def 						a__     (						_UpperCamelCase     :	list	,_UpperCamelCase     :	int							):
   __lowerCamelCase  							=      []  # type: list[int]
   __lowerCamelCase  							=      []  # type: list[int]
   backtrack(_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,_UpperCamelCase	,0							)
   return answer





def 						a__     (						):
   print(combination_sum([-8, 2.3, 0]	,1							)							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()






