
'''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	=    {
    '''MBZUAI/swiftformer-xs''': '''https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json''',
}

class 							_snake_case     (  lowerCAmelCase_ ):
	"""simple docstring"""





	_UpperCamelCase							:  str								=		'''swiftformer'''




	def __init__(						self				: Tuple					,						UpperCamelCase_				: Tuple=3					,						UpperCamelCase_				: int=[3, 3, 6, 4]					,						UpperCamelCase_				: Optional[int]=[48, 56, 112, 220]					,						UpperCamelCase_				: Optional[Any]=4					,						UpperCamelCase_				: List[Any]=[True, True, True, True]					,						UpperCamelCase_				: List[str]="gelu"					,						UpperCamelCase_				: Tuple=3					,						UpperCamelCase_				: Optional[int]=2					,						UpperCamelCase_				: Union[str, Any]=1					,						UpperCamelCase_				: Optional[int]=0.0					,						UpperCamelCase_				: Optional[int]=True					,						UpperCamelCase_				: Any=1E-5					,						UpperCamelCase_				: Tuple=1E-5					,						**UpperCamelCase_				: str					,						):
			super().__init__(**UpperCamelCase_      )
			lowerCAmelCase_   :       List[Any]    							=num_channels
			lowerCAmelCase_   :       str    							=depths
			lowerCAmelCase_   :       Any    							=embed_dims
			lowerCAmelCase_   :       List[Any]    							=mlp_ratio
			lowerCAmelCase_   :       Optional[Any]    							=downsamples
			lowerCAmelCase_   :       Optional[Any]    							=hidden_act
			lowerCAmelCase_   :       int    							=down_patch_size
			lowerCAmelCase_   :       List[Any]    							=down_stride
			lowerCAmelCase_   :       Tuple    							=down_pad
			lowerCAmelCase_   :       List[str]    							=drop_path_rate
			lowerCAmelCase_   :       Optional[Any]    							=use_layer_scale
			lowerCAmelCase_   :       Optional[Any]    							=layer_scale_init_value
			lowerCAmelCase_   :       int    							=batch_norm_eps







class 							_snake_case     (  lowerCAmelCase_ ):
	"""simple docstring"""





	_UpperCamelCase							:  Dict								=		version.parse('''1.11''' )




	@property
	def 	__A      (						self				: List[Any]      ):
			return OrderedDict(
			    [
			        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
			    ]      )





	@property
	def 	__A      (						self				: Optional[int]      ):
			return 1E-4








'''simple docstring'''






from __future__ import annotations







def 		SCREAMING_SNAKE_CASE__					(							_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ):
		if len(_SCREAMING_SNAKE_CASE  ) == 0:
				raise ValueError('''find_min() arg is an empty sequence'''  )
		if (
		    left >= len(_SCREAMING_SNAKE_CASE  )
		    or left < -len(_SCREAMING_SNAKE_CASE  )
		    or right >= len(_SCREAMING_SNAKE_CASE  )
		    or right < -len(_SCREAMING_SNAKE_CASE  )
		):
				raise IndexError('''list index out of range'''  )
		if left == right:
				return nums[left]
		lowerCAmelCase_   :       Dict    							=(left + right) >> 1  # the middle
		lowerCAmelCase_   :       Optional[int]    							=find_min(_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  ,					_SCREAMING_SNAKE_CASE  )  # find min in range[left, mid]
		lowerCAmelCase_   :       Any    							=find_min(_SCREAMING_SNAKE_CASE  ,					mid + 1  ,					_SCREAMING_SNAKE_CASE  )  # find min in range[mid + 1, right]

		return left_min if left_min <= right_min else right_min


if __name__ == "__main__":
							import doctest

							doctest.testmod(verbose=True)






