'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


SCREAMING_SNAKE_CASE_:     Union[str, Any]  =logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:     List[str]  ={
    'microsoft/focalnet-tiny': 'https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json',
}




class        __A      ( UpperCamelCase__		,	UpperCamelCase__	):
    a__       :						int          =  """focalnet"""



    def __init__(self    :    Optional[int]   ,			__a    :    int=224   ,			__a    :    List[str]=4   ,			__a    :    int=3   ,			__a    :    List[Any]=96   ,			__a    :    str=False   ,			__a    :    List[Any]=[192, 384, 768, 768]   ,			__a    :    Any=[2, 2, 6, 2]   ,			__a    :    int=[2, 2, 2, 2]   ,			__a    :    List[str]=[3, 3, 3, 3]   ,			__a    :    Dict="gelu"   ,			__a    :    Tuple=4.0   ,			__a    :    Dict=0.0   ,			__a    :    List[str]=0.1   ,			__a    :    str=False   ,			__a    :    Any=1E-4   ,			__a    :    Tuple=False   ,			__a    :    Any=False   ,			__a    :    Optional[int]=False   ,			__a    :    Any=0.02   ,			__a    :    Dict=1E-5   ,			__a    :    str=32   ,			__a    :    Dict=None   ,			__a    :    str=None   ,			**__a    :    str   ,			):
         super().__init__(**__a )

         UpperCAmelCase_           =   image_size
         UpperCAmelCase_           =   patch_size
         UpperCAmelCase_           =   num_channels
         UpperCAmelCase_           =   embed_dim
         UpperCAmelCase_           =   use_conv_embed
         UpperCAmelCase_           =   hidden_sizes
         UpperCAmelCase_           =   depths
         UpperCAmelCase_           =   focal_levels
         UpperCAmelCase_           =   focal_windows
         UpperCAmelCase_           =   hidden_act
         UpperCAmelCase_           =   mlp_ratio
         UpperCAmelCase_           =   hidden_dropout_prob
         UpperCAmelCase_           =   drop_path_rate
         UpperCAmelCase_           =   use_layerscale
         UpperCAmelCase_           =   layerscale_value
         UpperCAmelCase_           =   use_post_layernorm
         UpperCAmelCase_           =   use_post_layernorm_in_modulation
         UpperCAmelCase_           =   normalize_modulator
         UpperCAmelCase_           =   initializer_range
         UpperCAmelCase_           =   layer_norm_eps
         UpperCAmelCase_           =   encoder_stride
         UpperCAmelCase_           =   ["stem"] + [f"""stage{idx}""" for idx in range(1   ,			len(self.depths ) + 1 )]
         UpperCAmelCase_    , UpperCAmelCase_           =   get_aligned_output_features_output_indices(
             out_features=__a   ,			out_indices=__a   ,			stage_names=self.stage_names )





'''simple docstring'''





from __future__ import annotations





def 	lowerCAmelCase_				(					snake_case_       : list					,    snake_case_       : int | None = None					,    snake_case_       : int | None = None			)    ->      None:


     '''simple docstring'''




     if start is None:
          UpperCAmelCase_           =   0

     if end is None:
          UpperCAmelCase_           =   len(snake_case_			) - 1

     if start >= end:
          return

     UpperCAmelCase_           =   (start + end) // 2

     slowsort(snake_case_					,    snake_case_					,    snake_case_			)
     slowsort(snake_case_					,    mid + 1					,    snake_case_			)

     if sequence[end] < sequence[mid]:
          UpperCAmelCase_    , UpperCAmelCase_           =   sequence[mid], sequence[end]

     slowsort(snake_case_					,    snake_case_					,    end - 1			)


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

    testmod()




