


'''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


A__						:   Optional[Any]				=    logging.get_logger(__name__)

A__						:   List[Any]				=    {
    """sail/poolformer_s12""": """https://huggingface.co/sail/poolformer_s12/resolve/main/config.json""",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}





class   UpperCAmelCase_    (_UpperCAmelCase    ):





    """simple docstring"""






    lowerCamelCase    :   Optional[Any]					=     'poolformer'







    def __init__(				self     ,	SCREAMING_SNAKE_CASE_=3     ,	SCREAMING_SNAKE_CASE_=16     ,	SCREAMING_SNAKE_CASE_=16     ,	SCREAMING_SNAKE_CASE_=3     ,	SCREAMING_SNAKE_CASE_=4.0     ,	SCREAMING_SNAKE_CASE_=[2, 2, 6, 2]     ,	SCREAMING_SNAKE_CASE_=[64, 1_28, 3_20, 5_12]     ,	SCREAMING_SNAKE_CASE_=[7, 3, 3, 3]     ,	SCREAMING_SNAKE_CASE_=[4, 2, 2, 2]     ,	SCREAMING_SNAKE_CASE_=[2, 1, 1, 1]     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_="gelu"     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=1E-5     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	Union[str, Any]:
         __lowerCamelCase  :      int														=						num_channels
         __lowerCamelCase  :      Union[str, Any]														=						patch_size
         __lowerCamelCase  :      Optional[Any]														=						stride
         __lowerCamelCase  :      int														=						padding
         __lowerCamelCase  :      List[Any]														=						pool_size
         __lowerCamelCase  :      Dict														=						hidden_sizes
         __lowerCamelCase  :      str														=						mlp_ratio
         __lowerCamelCase  :      Tuple														=						depths
         __lowerCamelCase  :      Union[str, Any]														=						patch_sizes
         __lowerCamelCase  :      Dict														=						strides
         __lowerCamelCase  :      int														=						num_encoder_blocks
         __lowerCamelCase  :      Tuple														=						drop_path_rate
         __lowerCamelCase  :      Union[str, Any]														=						hidden_act
         __lowerCamelCase  :      List[Any]														=						use_layer_scale
         __lowerCamelCase  :      Tuple														=						layer_scale_init_value
         __lowerCamelCase  :      int														=						initializer_range
         super().__init__(**SCREAMING_SNAKE_CASE_      )







class   UpperCAmelCase_    (_UpperCAmelCase    ):





    """simple docstring"""






    lowerCamelCase    :   Optional[int]					=     version.parse('1.11'    )







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







    @property
    def  lowercase_							(				self      )							->	float:
         return 2E-3











"""simple docstring"""







def       _lowerCamelCase				(							UpperCAmelCase_ :       int     )	-> int:






	"""simple docstring"""





	assert (
	    isinstance(UpperCAmelCase_,	UpperCAmelCase_     ) and number_of_steps > 0
	), F"""number_of_steps needs to be positive integer, your input {number_of_steps}"""
	if number_of_steps == 1:
		return 1
	A__							,							A__											=					1, 1
	for _ in range(number_of_steps - 1     ):
		A__							,							A__											=					current + previous, current
	return current


if __name__ == "__main__":
			import doctest

			doctest.testmod()




