






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


__A      =				logging.get_logger(__name__)

__A      =				{
    '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 						SCREAMING_SNAKE_CASE				( snake_case					):





							"""simple docstring"""

							A_						  =					'deit'

							def __init__(  self:   Any		,     __A:   Union[str, Any]=7_68		,     __A:   Optional[Any]=12		,     __A:   Union[str, Any]=12		,     __A:   Optional[int]=30_72		,     __A:   Optional[int]="gelu"		,     __A:   Optional[Any]=0.0		,     __A:   List[Any]=0.0		,     __A:   int=0.02		,     __A:   List[str]=1e-12		,     __A:   Optional[int]=2_24		,     __A:   Tuple=16		,     __A:   List[Any]=3		,     __A:   List[str]=True		,     __A:   Any=16		,     **__A:   Union[str, Any]		,     )    ->				int:
												super().__init__(**__A   )

												_A								= hidden_size
												_A								= num_hidden_layers
												_A								= num_attention_heads
												_A								= intermediate_size
												_A								= hidden_act
												_A								= hidden_dropout_prob
												_A								= attention_probs_dropout_prob
												_A								= initializer_range
												_A								= layer_norm_eps
												_A								= image_size
												_A								= patch_size
												_A								= num_channels
												_A								= qkv_bias
												_A								= encoder_stride





class 						SCREAMING_SNAKE_CASE				( snake_case					):





							"""simple docstring"""

							A_						  =					version.parse("1.11"					)

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



							@property
							def       __A (  self:   Any   )    ->				float:
												return 1e-4











from __future__ import annotations




def      __A					(     _lowercase					,			_lowercase					,			_lowercase					,			_lowercase ):  # noqa: E741

					'''simple docstring'''







					while r - l > 1:
										_A								= (l + r) // 2
										if v[m] >= key:
															_A								= m
										else:
															_A								= m  # noqa: E741
					return r




def      __A					(     _lowercase ):

					'''simple docstring'''







					if len(_lowercase ) == 0:
										return 0

					_A								= [0] * len(_lowercase )
					_A								= 1

					_A								= v[0]

					for i in range(1					,			len(_lowercase ) ):
										if v[i] < tail[0]:
															_A								= v[i]
										elif v[i] > tail[length - 1]:
															_A								= v[i]
															length += 1
										else:
															_A								= v[i]

					return length


if __name__ == "__main__":
				import doctest

				doctest.testmod()



