




"""simple docstring"""


from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_A						=     logging.get_logger(__name__)


class _lowerCamelCase							(	_A  ,			_A		):
   _lowerCamelCase							:int       =      """maskformer-swin"""

   _lowerCamelCase							:Optional[Any]       =      {
       """num_attention_heads""": """num_heads""",
       """num_hidden_layers""": """num_layers""",
   }






   def __init__(						self  :						Optional[int]       ,      UpperCamelCase  :						int=2_24       ,      UpperCamelCase  :						Optional[int]=4       ,      UpperCamelCase  :						List[Any]=3       ,      UpperCamelCase  :						str=96       ,      UpperCamelCase  :						Any=[2, 2, 6, 2]       ,      UpperCamelCase  :						Dict=[3, 6, 12, 24]       ,      UpperCamelCase  :						List[str]=7       ,      UpperCamelCase  :						Any=4.0       ,      UpperCamelCase  :						Dict=True       ,      UpperCamelCase  :						List[str]=0.0       ,      UpperCamelCase  :						Dict=0.0       ,      UpperCamelCase  :						List[str]=0.1       ,      UpperCamelCase  :						Any="gelu"       ,      UpperCamelCase  :						Tuple=False       ,      UpperCamelCase  :						str=0.02       ,      UpperCamelCase  :						Optional[int]=1E-5       ,      UpperCamelCase  :						int=None       ,      UpperCamelCase  :						Any=None       ,      **UpperCamelCase  :						List[Any]       ,      )					->		List[str]:

         """simple docstring"""
         super().__init__(**snake_case_       )

         lowerCAmelCase__     :					Optional[Any]       =			image_size
         lowerCAmelCase__     :					Optional[int]       =			patch_size
         lowerCAmelCase__     :					Optional[int]       =			num_channels
         lowerCAmelCase__     :					Optional[int]       =			embed_dim
         lowerCAmelCase__     :					Any       =			depths
         lowerCAmelCase__     :					List[str]       =			len(snake_case_       )
         lowerCAmelCase__     :					str       =			num_heads
         lowerCAmelCase__     :					Any       =			window_size
         lowerCAmelCase__     :					List[str]       =			mlp_ratio
         lowerCAmelCase__     :					Dict       =			qkv_bias
         lowerCAmelCase__     :					Any       =			hidden_dropout_prob
         lowerCAmelCase__     :					List[str]       =			attention_probs_dropout_prob
         lowerCAmelCase__     :					Any       =			drop_path_rate
         lowerCAmelCase__     :					int       =			hidden_act
         lowerCAmelCase__     :					Dict       =			use_absolute_embeddings
         lowerCAmelCase__     :					List[Any]       =			layer_norm_eps
         lowerCAmelCase__     :					Dict       =			initializer_range
         # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
         # this indicates the channel dimension after the last stage of the model
         lowerCAmelCase__     :					int       =			int(embed_dim * 2 ** (len(snake_case_       ) - 1)       )
         lowerCAmelCase__     :					Any       =			["""stem"""] + [f"""stage{idx}""" for idx in range(1       ,      len(snake_case_       ) + 1       )]
         lowerCAmelCase__     :					Tuple       =			get_aligned_output_features_output_indices(
             out_features=snake_case_       ,      out_indices=snake_case_       ,      stage_names=self.stage_names       )







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


lowerCamelCase_    :			Any    =	logging.get_logger(__name__)

lowerCamelCase_    :			Dict    =	{
    """facebook/dpr-ctx_encoder-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-question_encoder-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-reader-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-ctx_encoder-multiset-base""": (
        """https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json"""
    ),
    """facebook/dpr-question_encoder-multiset-base""": (
        """https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json"""
    ),
    """facebook/dpr-reader-multiset-base""": (
        """https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json"""
    ),
}

class 							_UpperCamelCase					(       _A	):






			'''simple docstring'''

			__UpperCamelCase   :    Any          =			"""dpr"""

			def __init__(							self			:							str    ,						snake_case_			:							Any=3_0522    ,						snake_case_			:							List[str]=768    ,						snake_case_			:							List[str]=12    ,						snake_case_			:							Union[str, Any]=12    ,						snake_case_			:							Tuple=3072    ,						snake_case_			:							Any="gelu"    ,						snake_case_			:							Optional[Any]=0.1    ,						snake_case_			:							str=0.1    ,						snake_case_			:							Dict=512    ,						snake_case_			:							int=2    ,						snake_case_			:							Union[str, Any]=0.02    ,						snake_case_			:							str=1e-12    ,						snake_case_			:							List[str]=0    ,						snake_case_			:							Any="absolute"    ,						snake_case_			:							int = 0    ,						**snake_case_			:							int    ,						):
							super().__init__(pad_token_id=snake_case_    ,						**snake_case_   )

							UpperCamelCase_:				str						=    vocab_size
							UpperCamelCase_:				Optional[int]						=    hidden_size
							UpperCamelCase_:				int						=    num_hidden_layers
							UpperCamelCase_:				Any						=    num_attention_heads
							UpperCamelCase_:				int						=    hidden_act
							UpperCamelCase_:				Optional[Any]						=    intermediate_size
							UpperCamelCase_:				Tuple						=    hidden_dropout_prob
							UpperCamelCase_:				Tuple						=    attention_probs_dropout_prob
							UpperCamelCase_:				str						=    max_position_embeddings
							UpperCamelCase_:				Any						=    type_vocab_size
							UpperCamelCase_:				Tuple						=    initializer_range
							UpperCamelCase_:				List[Any]						=    layer_norm_eps
							UpperCamelCase_:				Tuple						=    projection_dim
							UpperCamelCase_:				Dict						=    position_embedding_type






