
from ....configuration_utils import PretrainedConfig
from ....utils import logging


lowerCamelCase_    :			Any    =	logging.get_logger(__name__)

lowerCamelCase_    :			List[str]    =	{
    """Visual-Attention-Network/van-base""": (
        """https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json"""
    ),
}

class 							_UpperCamelCase					(       _A	):






			'''simple docstring'''

			__UpperCamelCase   :    List[Any]          =			"""van"""

			def __init__(							self			:							Union[str, Any]    ,						snake_case_			:							List[str]=224    ,						snake_case_			:							List[Any]=3    ,						snake_case_			:							List[Any]=[7, 3, 3, 3]    ,						snake_case_			:							Dict=[4, 2, 2, 2]    ,						snake_case_			:							Tuple=[64, 128, 320, 512]    ,						snake_case_			:							Optional[int]=[3, 3, 12, 3]    ,						snake_case_			:							List[str]=[8, 8, 4, 4]    ,						snake_case_			:							Dict="gelu"    ,						snake_case_			:							Tuple=0.02    ,						snake_case_			:							Optional[int]=1e-6    ,						snake_case_			:							Dict=1e-2    ,						snake_case_			:							List[Any]=0.0    ,						snake_case_			:							Any=0.0    ,						**snake_case_			:							Tuple    ,						):
							super().__init__(**snake_case_   )
							UpperCamelCase_:				int						=    image_size
							UpperCamelCase_:				Union[str, Any]						=    num_channels
							UpperCamelCase_:				Tuple						=    patch_sizes
							UpperCamelCase_:				Dict						=    strides
							UpperCamelCase_:				Optional[Any]						=    hidden_sizes
							UpperCamelCase_:				Union[str, Any]						=    depths
							UpperCamelCase_:				List[str]						=    mlp_ratios
							UpperCamelCase_:				int						=    hidden_act
							UpperCamelCase_:				Optional[int]						=    initializer_range
							UpperCamelCase_:				Dict						=    layer_norm_eps
							UpperCamelCase_:				List[Any]						=    layer_scale_init_value
							UpperCamelCase_:				Dict						=    drop_path_rate
							UpperCamelCase_:				str						=    dropout_rate








from __future__ import annotations







def 							A__       (    lowerCamelCase    )	->						int:
				UpperCamelCase_:				Optional[Any]						=    len(lowerCamelCase    ) // 2

				# choose the middle 3 elements
				UpperCamelCase_:				Tuple						=    lst[m - 1 : m + 2]

				# if middle element is peak
				if three[1] > three[0] and three[1] > three[2]:
								return three[1]

				# if increasing, recurse on right
				elif three[0] < three[2]:
								if len(lst[:m]    ) == 2:
												m -= 1
								return peak(lst[m:]    )

				# decreasing
				else:
								if len(lst[:m]    ) == 2:
												m += 1
								return peak(lst[:m]    )


if __name__ == "__main__":
							import doctest

							doctest.testmod()






