




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


__SCREAMING_SNAKE_CASE     : str      =logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE     : int      ={
    """MBZUAI/swiftformer-xs""": """https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json""",
}






class       A      (		_lowerCAmelCase		):
     """simple docstring"""

     _snake_case:						int  ="swiftformer"




     def __init__(     self	: List[str]						,	A__	: Optional[int]=3						,	A__	: Tuple=[3, 3, 6, 4]						,	A__	: str=[4_8, 5_6, 1_1_2, 2_2_0]						,	A__	: List[str]=4						,	A__	: Optional[int]=[True, True, True, True]						,	A__	: Tuple="gelu"						,	A__	: List[Any]=3						,	A__	: Any=2						,	A__	: int=1						,	A__	: List[str]=0.0						,	A__	: Optional[Any]=True						,	A__	: Dict=1E-5						,	A__	: Union[str, Any]=1E-5						,	**A__	: Union[str, Any]						,	)					->							Dict:
           super().__init__(**A__      )
           lowerCamelCase__   	=					num_channels
           lowerCamelCase__   	=					depths
           lowerCamelCase__   	=					embed_dims
           lowerCamelCase__   	=					mlp_ratio
           lowerCamelCase__   	=					downsamples
           lowerCamelCase__   	=					hidden_act
           lowerCamelCase__   	=					down_patch_size
           lowerCamelCase__   	=					down_stride
           lowerCamelCase__   	=					down_pad
           lowerCamelCase__   	=					drop_path_rate
           lowerCamelCase__   	=					use_layer_scale
           lowerCamelCase__   	=					layer_scale_init_value
           lowerCamelCase__   	=					batch_norm_eps






class       A      (		_lowerCAmelCase		):
     """simple docstring"""

     _snake_case:						List[Any]  =version.parse("1.11"		)




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




     @property
     def 			__snake_case (     self	: List[str]      )					->							float:
           return 1E-4





def       lowerCAmelCase_      (	lowerCamelCase:							str    )       ->      int:


      '''simple docstring'''




      lowerCamelCase__   	=					str(lowerCamelCase    ).strip()
      if not bin_string:
            raise ValueError('Empty string was passed to the function'    )
      lowerCamelCase__   	=					bin_string[0] == '-'
      if is_negative:
            lowerCamelCase__   	=					bin_string[1:]
      if not all(char in '01' for char in bin_string    ):
            raise ValueError('Non-binary value was passed to the function'    )
      lowerCamelCase__   	=					0
      for char in bin_string:
            lowerCamelCase__   	=					2 * decimal_number + int(lowerCamelCase    )
      return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
      from doctest import testmod

      testmod()