





"""simple docstring"""






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


A	     =					logging.get_logger(__name__)

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




class 			__lowercase     (     lowerCamelCase__				, lowerCamelCase__							):
					__lowerCAmelCase					=					'''convnextv2'''







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

									__a	:  int         =					num_channels
									__a	:  Union[str, Any]         =					patch_size
									__a	:  Optional[int]         =					num_stages
									__a	:  Optional[Any]         =					[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
									__a	:  Dict         =					[3, 3, 9, 3] if depths is None else depths
									__a	:  Tuple         =					hidden_act
									__a	:  Union[str, Any]         =					initializer_range
									__a	:  Dict         =					layer_norm_eps
									__a	:  Union[str, Any]         =					drop_path_rate
									__a	:  Union[str, Any]         =					image_size
									__a	:  int         =					['''stem'''] + [f"""stage{idx}""" for idx in range(1		,     len(self.depths       ) + 1       )]
									__a	:  List[Any]         =					get_aligned_output_features_output_indices(
									    out_features=__A		,     out_indices=__A		,     stage_names=self.stage_names       )






"""simple docstring"""






def       __A (     a_  :float)						->						float:

				if edge <= 0 or not isinstance(a_				,    a_):
								raise ValueError('''Length must be a positive.''')
				return 3 * ((25 + 10 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)

def       __A (     a_  :float)						->						float:

				if edge <= 0 or not isinstance(a_				,    a_):
								raise ValueError('''Length must be a positive.''')
				return ((15 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
		import doctest

		doctest.testmod()