






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_				(      lowercase						,      lowercase	):







				"""simple docstring"""




				_snake_case				:   str        =			"""convnextv2"""







				def __init__( self     :Dict  ,     lowerCamelCase__     :List[str]=3  ,     lowerCamelCase__     :Dict=4  ,     lowerCamelCase__     :List[str]=4  ,     lowerCamelCase__     :Dict=None  ,     lowerCamelCase__     :Dict=None  ,     lowerCamelCase__     :List[str]="gelu"  ,     lowerCamelCase__     :str=0.02  ,     lowerCamelCase__     :str=1e-12  ,     lowerCamelCase__     :int=0.0  ,     lowerCamelCase__     :str=2_24  ,     lowerCamelCase__     :Tuple=None  ,     lowerCamelCase__     :Optional[Any]=None  ,     **lowerCamelCase__     :List[Any]  ,     ):
					super().__init__(**lowerCamelCase__     )

					UpperCamelCase__ :List[str]						=      num_channels
					UpperCamelCase__ :Optional[Any]						=      patch_size
					UpperCamelCase__ :Union[str, Any]						=      num_stages
					UpperCamelCase__ :List[str]						=      [96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
					UpperCamelCase__ :int						=      [3, 3, 9, 3] if depths is None else depths
					UpperCamelCase__ :int						=      hidden_act
					UpperCamelCase__ :Optional[Any]						=      initializer_range
					UpperCamelCase__ :Optional[int]						=      layer_norm_eps
					UpperCamelCase__ :Any						=      drop_path_rate
					UpperCamelCase__ :Dict						=      image_size
					UpperCamelCase__ :Union[str, Any]						=      ["""stem"""] + [f"""stage{idx}""" for idx in range(1  ,     len(self.depths     ) + 1     )]
					UpperCamelCase__				,		UpperCamelCase__ :int						=      get_aligned_output_features_output_indices(
					    out_features=lowerCamelCase__  ,     out_indices=lowerCamelCase__  ,     stage_names=self.stage_names     )




"""simple docstring"""







def     UpperCAmelCase_					(				__a   :			float      ,							__a   :			float						):




			'''simple docstring'''



			if density <= 0:
						raise ValueError('Impossible fluid density'						)
			if bulk_modulus <= 0:
						raise ValueError('Impossible bulk modulus'						)

			return (bulk_modulus / density) ** 0.5


if __name__ == "__main__":
	import doctest

	doctest.testmod()





