


from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowerCamelCase						=		logging.get_logger(__name__)

lowerCamelCase						=		{
    '''microsoft/resnet-50''': '''https://huggingface.co/microsoft/resnet-50/blob/main/config.json''',
}





class  _a							(    _lowercase					,						_lowercase):
	_a  :  Optional[Any]				   =							'''resnet'''
	_a  :  int				   =							['''basic''', '''bottleneck''']




	def __init__( self						:		List[Any]		, _SCREAMING_SNAKE_CASE						:		Optional[int]=3		, _SCREAMING_SNAKE_CASE						:		List[Any]=64		, _SCREAMING_SNAKE_CASE						:		Union[str, Any]=[256, 512, 1024, 2048]		, _SCREAMING_SNAKE_CASE						:		Any=[3, 4, 6, 3]		, _SCREAMING_SNAKE_CASE						:		str="bottleneck"		, _SCREAMING_SNAKE_CASE						:		Union[str, Any]="relu"		, _SCREAMING_SNAKE_CASE						:		Optional[int]=False		, _SCREAMING_SNAKE_CASE						:		Optional[Any]=None		, _SCREAMING_SNAKE_CASE						:		str=None		, **_SCREAMING_SNAKE_CASE						:		List[str]		, )->	List[str]:
			super().__init__(**_SCREAMING_SNAKE_CASE		)
			if layer_type not in self.layer_types:
					raise ValueError(F'layer_type={layer_type} is not one of {",".join(self.layer_types		)}'		)
			lowerCAmelCase__       :      List[str]   					= num_channels
			lowerCAmelCase__       :      List[Any]   					= embedding_size
			lowerCAmelCase__       :      Tuple   					= hidden_sizes
			lowerCAmelCase__       :      Union[str, Any]   					= depths
			lowerCAmelCase__       :      Tuple   					= layer_type
			lowerCAmelCase__       :      Union[str, Any]   					= hidden_act
			lowerCAmelCase__       :      int   					= downsample_in_first_stage
			lowerCAmelCase__       :      int   					= ['''stem'''] + [F'stage{idx}' for idx in range(1		, len(_SCREAMING_SNAKE_CASE		) + 1		)]
			lowerCAmelCase__					,     lowerCAmelCase__       :      Any   					= get_aligned_output_features_output_indices(
			    out_features=_SCREAMING_SNAKE_CASE		, out_indices=_SCREAMING_SNAKE_CASE		, stage_names=self.stage_names		)





class  _a							(    _lowercase):
	_a  :  Any				   =							version.parse('''1.11''')




	@property
	def 							UpperCAmelCase__( self						:		Tuple		)->	Mapping[str, Mapping[int, str]]:
			return OrderedDict(
			    [
			        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
			    ]		)




	@property
	def 							UpperCAmelCase__( self						:		Optional[int]		)->	float:
			return 1E-3








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


lowerCamelCase						=		logging.get_logger(__name__)

lowerCamelCase						=		{
    '''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  _a							(    _lowercase):
	_a  :  List[Any]				   =							'''dpr'''




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

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




