



"""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


UpperCAmelCase						:		Optional[int]			= logging.get_logger(__name__)

UpperCAmelCase						:		Dict			= {
    "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    SCREAMING_SNAKE_CASE__ (							__UpperCAmelCase   ):
    lowercase__      =   "yolos"

    def __init__(				self			:				Optional[int] ,  lowerCAmelCase_			:				Dict=7_6_8 ,  lowerCAmelCase_			:				Tuple=1_2 ,  lowerCAmelCase_			:				List[Any]=1_2 ,  lowerCAmelCase_			:				int=3_0_7_2 ,  lowerCAmelCase_			:				Union[str, Any]="gelu" ,  lowerCAmelCase_			:				Union[str, Any]=0.0 ,  lowerCAmelCase_			:				Union[str, Any]=0.0 ,  lowerCAmelCase_			:				Union[str, Any]=0.02 ,  lowerCAmelCase_			:				List[Any]=1E-12 ,  lowerCAmelCase_			:				Dict=[5_1_2, 8_6_4] ,  lowerCAmelCase_			:				Union[str, Any]=1_6 ,  lowerCAmelCase_			:				Dict=3 ,  lowerCAmelCase_			:				Union[str, Any]=True ,  lowerCAmelCase_			:				str=1_0_0 ,  lowerCAmelCase_			:				Union[str, Any]=True ,  lowerCAmelCase_			:				Any=False ,  lowerCAmelCase_			:				Any=1 ,  lowerCAmelCase_			:				int=5 ,  lowerCAmelCase_			:				Tuple=2 ,  lowerCAmelCase_			:				Optional[int]=5 ,  lowerCAmelCase_			:				int=2 ,  lowerCAmelCase_			:				Tuple=0.1 ,  **lowerCAmelCase_			:				List[Any] ,  ):







      """simple docstring"""







      super().__init__(**lowerCAmelCase_)

      lowercase_								= hidden_size
      lowercase_								= num_hidden_layers
      lowercase_								= num_attention_heads
      lowercase_								= intermediate_size
      lowercase_								= hidden_act
      lowercase_								= hidden_dropout_prob
      lowercase_								= attention_probs_dropout_prob
      lowercase_								= initializer_range
      lowercase_								= layer_norm_eps
      lowercase_								= image_size
      lowercase_								= patch_size
      lowercase_								= num_channels
      lowercase_								= qkv_bias
      lowercase_								= num_detection_tokens
      lowercase_								= use_mid_position_embeddings
      lowercase_								= auxiliary_loss
      # Hungarian matcher
      lowercase_								= class_cost
      lowercase_								= bbox_cost
      lowercase_								= giou_cost
      # Loss coefficients
      lowercase_								= bbox_loss_coefficient
      lowercase_								= giou_loss_coefficient
      lowercase_								= eos_coefficient







class    SCREAMING_SNAKE_CASE__ (							__UpperCAmelCase   ):
    lowercase__      =   version.parse("1.11"   )

    @property
    def 					_UpperCAmelCase	(				self			:				Tuple):







      """simple docstring"""







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

    @property
    def 					_UpperCAmelCase	(				self			:				Optional[Any]):







      """simple docstring"""







      return 1E-4




    @property
    def 					_UpperCAmelCase	(				self			:				Optional[int]):







      """simple docstring"""







      return 1_2






"""simple docstring"""
def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						int:







  '''simple docstring'''


  while a != 0:
    lowercase_					,    lowercase_								= b % a, a
  return b


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						int:







  '''simple docstring'''


  if gcd(__lowerCAmelCase ,  __lowerCAmelCase							) != 1:
    lowercase_								= F'''mod inverse of {a!r} and {m!r} does not exist'''
    raise ValueError(__lowerCAmelCase							)
  lowercase_					,    lowercase_					,    lowercase_								= 1, 0, a
  lowercase_					,    lowercase_					,    lowercase_								= 0, 1, m
  while va != 0:
    lowercase_								= ua // va
    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_								= (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
  return ua % m

