





'''simple docstring'''






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


A_		:  Dict		 =						logging.get_logger(__name__)

A_		:  Optional[Any]		 =						{
    "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json",
}
class 					__snake_case  (					__SCREAMING_SNAKE_CASE		,				__SCREAMING_SNAKE_CASE							):






   '''simple docstring'''





   lowerCamelCase__    							=      '''convnextv2'''

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

    snake_case__     :					Union[str, Any]    =  num_channels
    snake_case__     :					str    =  patch_size
    snake_case__     :					List[Any]    =  num_stages
    snake_case__     :					Optional[Any]    =  [9_6, 1_9_2, 3_8_4, 7_6_8] if hidden_sizes is None else hidden_sizes
    snake_case__     :					Dict    =  [3, 3, 9, 3] if depths is None else depths
    snake_case__     :					List[str]    =  hidden_act
    snake_case__     :					str    =  initializer_range
    snake_case__     :					Tuple    =  layer_norm_eps
    snake_case__     :					int    =  drop_path_rate
    snake_case__     :					Dict    =  image_size
    snake_case__     :					Optional[int]    =  ["""stem"""] + [f"stage{idx}" for idx in range(1	,		len(self.depths       ) + 1       )]
    snake_case__  ,							snake_case__     :					Optional[int]    =  get_aligned_output_features_output_indices(
        out_features=__SCREAMING_SNAKE_CASE	,		out_indices=__SCREAMING_SNAKE_CASE	,		stage_names=self.stage_names       )











'''simple docstring'''






from __future__ import annotations






def   __A    (				a_    :	float   ,a_    :	float   ,a_    :	float   ,):
		if (electron_conc, hole_conc, intrinsic_conc).count(0						) != 1:
				raise ValueError("You cannot supply more or less than 2 values"						)
		elif electron_conc < 0:
				raise ValueError("Electron concentration cannot be negative in a semiconductor"						)
		elif hole_conc < 0:
				raise ValueError("Hole concentration cannot be negative in a semiconductor"						)
		elif intrinsic_conc < 0:
				raise ValueError(
				    "Intrinsic concentration cannot be negative in a semiconductor"						)
		elif electron_conc == 0:
				return (
				    "electron_conc",
				    intrinsic_conc**2 / hole_conc,
				)
		elif hole_conc == 0:
				return (
				    "hole_conc",
				    intrinsic_conc**2 / electron_conc,
				)
		elif intrinsic_conc == 0:
				return (
				    "intrinsic_conc",
				    (electron_conc * hole_conc) ** 0.5,
				)
		else:
				return (-1, -1)


if __name__ == "__main__":
					import doctest

					doctest.testmod()



