




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


_snake_case				:				Dict       							=		logging.get_logger(__name__)

_snake_case				:				Dict       							=		{
    "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       A   (		_SCREAMING_SNAKE_CASE   ):
							lowercase_          =    'poolformer'







							def __init__(  self	:  Any							,      lowerCAmelCase_	:  Union[str, Any]=3							,      lowerCAmelCase_	:  Dict=16							,      lowerCAmelCase_	:  Tuple=16							,      lowerCAmelCase_	:  str=3							,      lowerCAmelCase_	:  Union[str, Any]=4.0							,      lowerCAmelCase_	:  List[str]=[2, 2, 6, 2]							,      lowerCAmelCase_	:  int=[64, 1_28, 3_20, 5_12]							,      lowerCAmelCase_	:  Union[str, Any]=[7, 3, 3, 3]							,      lowerCAmelCase_	:  Any=[4, 2, 2, 2]							,      lowerCAmelCase_	:  Dict=[2, 1, 1, 1]							,      lowerCAmelCase_	:  str=4							,      lowerCAmelCase_	:  Tuple=0.0							,      lowerCAmelCase_	:  List[Any]="gelu"							,      lowerCAmelCase_	:  List[Any]=True							,      lowerCAmelCase_	:  Union[str, Any]=1e-5							,      lowerCAmelCase_	:  Optional[Any]=0.0_2							,      **lowerCAmelCase_	:  Optional[Any]							,      )      ->							Tuple:


														"""simple docstring"""


														_a     					=    num_channels
														_a     					=    patch_size
														_a     					=    stride
														_a     					=    padding
														_a     					=    pool_size
														_a     					=    hidden_sizes
														_a     					=    mlp_ratio
														_a     					=    depths
														_a     					=    patch_sizes
														_a     					=    strides
														_a     					=    num_encoder_blocks
														_a     					=    drop_path_rate
														_a     					=    hidden_act
														_a     					=    use_layer_scale
														_a     					=    layer_scale_init_value
														_a     					=    initializer_range
														super().__init__(**lowerCAmelCase_ )



class       A   (		_SCREAMING_SNAKE_CASE   ):
							lowercase_          =    version.parse('1.11'   )







							@property
							def        __lowerCAmelCase      (  self	:  Dict )      ->							Mapping[str, Mapping[int, str]]:


														"""simple docstring"""


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







							@property
							def        __lowerCAmelCase      (  self	:  Optional[int] )      ->							float:


														"""simple docstring"""


														return 2e-3







'''simple docstring'''


from __future__ import annotations
def 		snake_case_   (UpperCamelCase	:  list[int]				):





							'''simple docstring'''


							if not nums:
														return 0
							_a     					=    nums[0]
							_a     					=    0
							for num in nums[1:]:
														_a					,							_a     					=    (
														    max_excluding + num,
														    max(UpperCamelCase			,						UpperCamelCase				),
														)
							return max(UpperCamelCase			,						UpperCamelCase				)


if __name__ == "__main__":
				import doctest

				doctest.testmod()

