






"""simple docstring"""







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


_UpperCamelCase					      =  logging.get_logger(__name__)

_UpperCamelCase					      =  {
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}







class  lowerCamelCase__ (	snake_case   ,					snake_case			):
    SCREAMING_SNAKE_CASE		=      '''convnextv2'''






    def __init__(			self     ,A=3     ,A=4     ,A=4     ,A=None     ,A=None     ,A="gelu"     ,A=0.02     ,A=1e-1_2     ,A=0.0     ,A=224     ,A=None     ,A=None     ,**A     ,):
          super().__init__(**A )

          UpperCAmelCase          =	num_channels
          UpperCAmelCase          =	patch_size
          UpperCAmelCase          =	num_stages
          UpperCAmelCase          =	[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
          UpperCAmelCase          =	[3, 3, 9, 3] if depths is None else depths
          UpperCAmelCase          =	hidden_act
          UpperCAmelCase          =	initializer_range
          UpperCAmelCase          =	layer_norm_eps
          UpperCAmelCase          =	drop_path_rate
          UpperCAmelCase          =	image_size
          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 _a			(		_snake_case				,	_snake_case = None				,	_snake_case = 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()



