

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


__lowercase     : str       =						logging.get_logger(__name__)

__lowercase     : Dict       =						{
    '''facebook/convnextv2-tiny-1k-224''': '''https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json''',
}



class 						_A     (				snake_case						,    snake_case				):





  '''simple docstring'''



  __lowerCamelCase			:      Optional[int]					=   '''convnextv2'''





  def __init__(  self   ,SCREAMING_SNAKE_CASE_=3   ,SCREAMING_SNAKE_CASE_=4   ,SCREAMING_SNAKE_CASE_=4   ,SCREAMING_SNAKE_CASE_=None   ,SCREAMING_SNAKE_CASE_=None   ,SCREAMING_SNAKE_CASE_="gelu"   ,SCREAMING_SNAKE_CASE_=0.02   ,SCREAMING_SNAKE_CASE_=1E-12   ,SCREAMING_SNAKE_CASE_=0.0   ,SCREAMING_SNAKE_CASE_=224   ,SCREAMING_SNAKE_CASE_=None   ,SCREAMING_SNAKE_CASE_=None   ,**SCREAMING_SNAKE_CASE_   ,):

      '''simple docstring'''
      super().__init__(**SCREAMING_SNAKE_CASE_    )

      snake_case							:		Dict        =		num_channels
      snake_case							:		List[str]        =		patch_size
      snake_case							:		List[Any]        =		num_stages
      snake_case							:		Union[str, Any]        =		[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
      snake_case							:		Optional[Any]        =		[3, 3, 9, 3] if depths is None else depths
      snake_case							:		List[Any]        =		hidden_act
      snake_case							:		Optional[Any]        =		initializer_range
      snake_case							:		str        =		layer_norm_eps
      snake_case							:		str        =		drop_path_rate
      snake_case							:		Any        =		image_size
      snake_case							:		Tuple        =		["""stem"""] + [F"""stage{idx}""" for idx in range(1   ,len(self.depths    ) + 1    )]
      snake_case      ,		snake_case							:		str        =		get_aligned_output_features_output_indices(
          out_features=SCREAMING_SNAKE_CASE_   ,out_indices=SCREAMING_SNAKE_CASE_   ,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


UpperCAmelCase_			:  int										=   logging.get_logger(__name__)

UpperCAmelCase_			:  List[Any]										=   {
    'facebook/deit-base-distilled-patch16-224': (
        'https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json'
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}

class     _lowerCamelCase       (     snake_case_					):




 '''simple docstring'''
 __lowercase					:		Union[str, Any]     				=    '''deit'''


 def __init__(   self   ,   __lowercase=768   ,   __lowercase=12   ,   __lowercase=12   ,   __lowercase=3_072   ,   __lowercase="gelu"   ,   __lowercase=0.0   ,   __lowercase=0.0   ,   __lowercase=0.0_2   ,   __lowercase=1E-12   ,   __lowercase=224   ,   __lowercase=16   ,   __lowercase=3   ,   __lowercase=True   ,   __lowercase=16   ,   **__lowercase   ,   ):

  """simple docstring"""







  super().__init__(**__lowercase    )

  __A	:		Union[str, Any]	  =      hidden_size
  __A	:		int	  =      num_hidden_layers
  __A	:		str	  =      num_attention_heads
  __A	:		Optional[int]	  =      intermediate_size
  __A	:		List[str]	  =      hidden_act
  __A	:		str	  =      hidden_dropout_prob
  __A	:		str	  =      attention_probs_dropout_prob
  __A	:		int	  =      initializer_range
  __A	:		Tuple	  =      layer_norm_eps
  __A	:		List[Any]	  =      image_size
  __A	:		Dict	  =      patch_size
  __A	:		Optional[Any]	  =      num_channels
  __A	:		List[Any]	  =      qkv_bias
  __A	:		str	  =      encoder_stride


class     _lowerCamelCase       (     snake_case_					):




 '''simple docstring'''
 __lowercase					:		Optional[int]     				=    version.parse('''1.11'''					)


 @property
 def 			snake_case__ (   self    ):

  """simple docstring"""







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







 @property
 def 			snake_case__ (   self    ):

  """simple docstring"""







  return 1E-4






