

'''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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCAmelCase				: Any         =  logging.get_logger(__name__)

UpperCAmelCase				: Union[str, Any]         =  {
    'facebook/convnext-tiny-224': 'https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json',
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}







class 		lowerCAmelCase__     (   lowerCamelCase__				,      lowerCamelCase__      ):



 """simple docstring"""



 lowerCAmelCase__						      =   'convnext'
 def __init__(	self      : int      ,							__SCREAMING_SNAKE_CASE      : Optional[Any]=3      ,							__SCREAMING_SNAKE_CASE      : Dict=4      ,							__SCREAMING_SNAKE_CASE      : Dict=4      ,							__SCREAMING_SNAKE_CASE      : Dict=None      ,							__SCREAMING_SNAKE_CASE      : List[Any]=None      ,							__SCREAMING_SNAKE_CASE      : Optional[int]="gelu"      ,							__SCREAMING_SNAKE_CASE      : Dict=0.02      ,							__SCREAMING_SNAKE_CASE      : str=1E-12      ,							__SCREAMING_SNAKE_CASE      : Any=1E-6      ,							__SCREAMING_SNAKE_CASE      : Dict=0.0      ,							__SCREAMING_SNAKE_CASE      : List[Any]=224      ,							__SCREAMING_SNAKE_CASE      : List[str]=None      ,							__SCREAMING_SNAKE_CASE      : List[Any]=None      ,							**__SCREAMING_SNAKE_CASE      : Union[str, Any]      ,							)						->				List[str]:


      """simple docstring"""




      super().__init__(**lowercase_    )

      __SCREAMING_SNAKE_CASE						     =   num_channels
      __SCREAMING_SNAKE_CASE						     =   patch_size
      __SCREAMING_SNAKE_CASE						     =   num_stages
      __SCREAMING_SNAKE_CASE						     =   [96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
      __SCREAMING_SNAKE_CASE						     =   [3, 3, 9, 3] if depths is None else depths
      __SCREAMING_SNAKE_CASE						     =   hidden_act
      __SCREAMING_SNAKE_CASE						     =   initializer_range
      __SCREAMING_SNAKE_CASE						     =   layer_norm_eps
      __SCREAMING_SNAKE_CASE						     =   layer_scale_init_value
      __SCREAMING_SNAKE_CASE						     =   drop_path_rate
      __SCREAMING_SNAKE_CASE						     =   image_size
      __SCREAMING_SNAKE_CASE						     =   ["""stem"""] + [f'stage{idx}' for idx in range(1      ,							len(self.depths    ) + 1    )]
      __SCREAMING_SNAKE_CASE     ,    __SCREAMING_SNAKE_CASE						     =   get_aligned_output_features_output_indices(
          out_features=lowercase_      ,							out_indices=lowercase_      ,							stage_names=self.stage_names    )







class 		lowerCAmelCase__     (   lowerCamelCase__      ):



 """simple docstring"""



 lowerCAmelCase__						      =   version.parse("1.11"      )
 @property
 def    UpperCAmelCase__	(	self      : Union[str, Any]    )						->				Mapping[str, Mapping[int, str]]:


      """simple docstring"""




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


 @property
 def    UpperCAmelCase__	(	self      : List[Any]    )						->				float:


      """simple docstring"""




      return 1E-5









'''simple docstring'''



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


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

UpperCAmelCase				: Optional[int]         =  {
    'bert-base-uncased': 'https://huggingface.co/bert-base-uncased/resolve/main/config.json',
    # QDQBERT models can be loaded from any BERT checkpoint, available at https://huggingface.co/models?filter=bert
}







class 		lowerCAmelCase__     (   a      ):



 """simple docstring"""



 lowerCAmelCase__						      =   "qdqbert"
 def __init__(	self      : str      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=30_522      ,							__SCREAMING_SNAKE_CASE      : str=768      ,							__SCREAMING_SNAKE_CASE      : Union[str, Any]=12      ,							__SCREAMING_SNAKE_CASE      : Any=12      ,							__SCREAMING_SNAKE_CASE      : Any=3_072      ,							__SCREAMING_SNAKE_CASE      : List[str]="gelu"      ,							__SCREAMING_SNAKE_CASE      : Any=0.1      ,							__SCREAMING_SNAKE_CASE      : Any=0.1      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=512      ,							__SCREAMING_SNAKE_CASE      : List[str]=2      ,							__SCREAMING_SNAKE_CASE      : Dict=0.02      ,							__SCREAMING_SNAKE_CASE      : List[str]=1E-12      ,							__SCREAMING_SNAKE_CASE      : str=True      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=1      ,							__SCREAMING_SNAKE_CASE      : Optional[int]=0      ,							__SCREAMING_SNAKE_CASE      : Dict=2      ,							**__SCREAMING_SNAKE_CASE      : Union[str, Any]      ,							)						->				str:


      """simple docstring"""




      super().__init__(pad_token_id=__SCREAMING_SNAKE_CASE      ,							bos_token_id=__SCREAMING_SNAKE_CASE      ,							eos_token_id=__SCREAMING_SNAKE_CASE      ,							**__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE						     =   vocab_size
      __SCREAMING_SNAKE_CASE						     =   max_position_embeddings
      __SCREAMING_SNAKE_CASE						     =   hidden_size
      __SCREAMING_SNAKE_CASE						     =   num_hidden_layers
      __SCREAMING_SNAKE_CASE						     =   num_attention_heads
      __SCREAMING_SNAKE_CASE						     =   intermediate_size
      __SCREAMING_SNAKE_CASE						     =   hidden_act
      __SCREAMING_SNAKE_CASE						     =   hidden_dropout_prob
      __SCREAMING_SNAKE_CASE						     =   attention_probs_dropout_prob
      __SCREAMING_SNAKE_CASE						     =   initializer_range
      __SCREAMING_SNAKE_CASE						     =   type_vocab_size
      __SCREAMING_SNAKE_CASE						     =   layer_norm_eps
      __SCREAMING_SNAKE_CASE						     =   use_cache






