






"""simple docstring"""



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


__A						:			Union[str, Any]    							=						logging.get_logger(__name__)

__A						:			Any    							=						{
    '''google/bit-50''': '''https://huggingface.co/google/bit-50/resolve/main/config.json''',
}





class    _UpperCAmelCase			(					__SCREAMING_SNAKE_CASE  ,		__SCREAMING_SNAKE_CASE				):
					SCREAMING_SNAKE_CASE_						:							Dict				       =  "bit"
					SCREAMING_SNAKE_CASE_						:							str				       =  ["preactivation", "bottleneck"]
					SCREAMING_SNAKE_CASE_						:							Optional[Any]				       =  ["SAME", "VALID"]




					def __init__(							self	:		int       ,		A	:		Dict=3       ,		A	:		Optional[int]=64       ,		A	:		int=[2_56, 5_12, 10_24, 20_48]       ,		A	:		int=[3, 4, 6, 3]       ,		A	:		List[Any]="preactivation"       ,		A	:		Union[str, Any]="relu"       ,		A	:		Dict=None       ,		A	:		int=32       ,		A	:		Union[str, Any]=0.0       ,		A	:		Union[str, Any]=False       ,		A	:		Union[str, Any]=32       ,		A	:		Optional[int]=1       ,		A	:		Optional[int]=None       ,		A	:		int=None       ,		**A	:		Tuple       ,		)    ->    Union[str, Any]:
							super().__init__(**UpperCamelCase__  )
							if layer_type not in self.layer_types:
									raise ValueError(F'''layer_type={layer_type} is not one of {','.join(self.layer_types  )}'''  )
							if global_padding is not None:
									if global_padding.upper() in self.supported_padding:
											lowercase_					:					List[Any]							=  global_padding.upper()
									else:
											raise ValueError(F'''Padding strategy {global_padding} not supported'''  )
							lowercase_					:					Union[str, Any]							=  num_channels
							lowercase_					:					Optional[Any]							=  embedding_size
							lowercase_					:					Tuple							=  hidden_sizes
							lowercase_					:					Union[str, Any]							=  depths
							lowercase_					:					str							=  layer_type
							lowercase_					:					str							=  hidden_act
							lowercase_					:					Union[str, Any]							=  global_padding
							lowercase_					:					Optional[int]							=  num_groups
							lowercase_					:					Any							=  drop_path_rate
							lowercase_					:					Union[str, Any]							=  embedding_dynamic_padding
							lowercase_					:					Union[str, Any]							=  output_stride
							lowercase_					:					str							=  width_factor

							lowercase_					:					List[str]							=  ['''stem'''] + [F'''stage{idx}''' for idx in range(1       ,		len(UpperCamelCase__  ) + 1  )]
							lowercase_					:					Union[str, Any]							=  get_aligned_output_features_output_indices(
							    out_features=UpperCamelCase__       ,		out_indices=UpperCamelCase__       ,		stage_names=self.stage_names  )





'''simple docstring'''
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


lowercase__						       =      logging.get_logger(__name__)

lowercase__						       =      {
    "hustvl/yolos-small": "https://huggingface.co/hustvl/yolos-small/resolve/main/config.json",
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}






class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						"""yolos"""



		def __init__(      self				:			Any  ,	UpperCamelCase__				:			Optional[Any]=768  ,	UpperCamelCase__				:			Any=12  ,	UpperCamelCase__				:			Optional[int]=12  ,	UpperCamelCase__				:			Union[str, Any]=3072  ,	UpperCamelCase__				:			str="gelu"  ,	UpperCamelCase__				:			Union[str, Any]=0.0  ,	UpperCamelCase__				:			Union[str, Any]=0.0  ,	UpperCamelCase__				:			Union[str, Any]=0.02  ,	UpperCamelCase__				:			List[Any]=1e-1_2  ,	UpperCamelCase__				:			List[Any]=[512, 864]  ,	UpperCamelCase__				:			int=16  ,	UpperCamelCase__				:			Union[str, Any]=3  ,	UpperCamelCase__				:			Union[str, Any]=True  ,	UpperCamelCase__				:			int=100  ,	UpperCamelCase__				:			Optional[Any]=True  ,	UpperCamelCase__				:			int=False  ,	UpperCamelCase__				:			Dict=1  ,	UpperCamelCase__				:			Optional[int]=5  ,	UpperCamelCase__				:			List[str]=2  ,	UpperCamelCase__				:			Union[str, Any]=5  ,	UpperCamelCase__				:			Union[str, Any]=2  ,	UpperCamelCase__				:			int=0.1  ,	**UpperCamelCase__				:			Optional[Any]  ,	)						->			Any:






				"""simple docstring"""







				super().__init__(**UpperCamelCase__      )

				snake_case  :       List[str]     			=						hidden_size
				snake_case  :       Union[str, Any]     			=						num_hidden_layers
				snake_case  :       List[str]     			=						num_attention_heads
				snake_case  :       Any     			=						intermediate_size
				snake_case  :       int     			=						hidden_act
				snake_case  :       Optional[Any]     			=						hidden_dropout_prob
				snake_case  :       int     			=						attention_probs_dropout_prob
				snake_case  :       Union[str, Any]     			=						initializer_range
				snake_case  :       List[Any]     			=						layer_norm_eps
				snake_case  :       Tuple     			=						image_size
				snake_case  :       Any     			=						patch_size
				snake_case  :       str     			=						num_channels
				snake_case  :       Optional[int]     			=						qkv_bias
				snake_case  :       Optional[Any]     			=						num_detection_tokens
				snake_case  :       Dict     			=						use_mid_position_embeddings
				snake_case  :       List[Any]     			=						auxiliary_loss
				# Hungarian matcher
				snake_case  :       List[str]     			=						class_cost
				snake_case  :       Optional[Any]     			=						bbox_cost
				snake_case  :       Tuple     			=						giou_cost
				# Loss coefficients
				snake_case  :       Union[str, Any]     			=						bbox_loss_coefficient
				snake_case  :       List[Any]     			=						giou_loss_coefficient
				snake_case  :       Tuple     			=						eos_coefficient







class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						version.parse("""1.11"""					)



		@property
		def       lowerCAmelCase				(      self				:			int      )						->			Mapping[str, Mapping[int, str]]:






				"""simple docstring"""







				return OrderedDict(
				    [
				        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
				    ]      )



		@property
		def       lowerCAmelCase				(      self				:			int      )						->			float:






				"""simple docstring"""







				return 1e-4



		@property
		def       lowerCAmelCase				(      self				:			Tuple      )						->			int:






				"""simple docstring"""







				return 12


