






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


a		:       Tuple			     = logging.get_logger(__name__)

a		:       str			     = {
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}
class     a    ( lowercase__							,       lowercase__   ):



      """simple docstring"""


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

        __UpperCAmelCase							:	List[str]           =  image_size
        __UpperCAmelCase							:	Optional[Any]           =  patch_size
        __UpperCAmelCase							:	Union[str, Any]           =  num_channels
        __UpperCAmelCase							:	List[str]           =  embed_dim
        __UpperCAmelCase							:	List[str]           =  use_conv_embed
        __UpperCAmelCase							:	Tuple           =  hidden_sizes
        __UpperCAmelCase							:	Optional[Any]           =  depths
        __UpperCAmelCase							:	Tuple           =  focal_levels
        __UpperCAmelCase							:	str           =  focal_windows
        __UpperCAmelCase							:	List[Any]           =  hidden_act
        __UpperCAmelCase							:	List[Any]           =  mlp_ratio
        __UpperCAmelCase							:	List[str]           =  hidden_dropout_prob
        __UpperCAmelCase							:	Dict           =  drop_path_rate
        __UpperCAmelCase							:	List[str]           =  use_layerscale
        __UpperCAmelCase							:	Tuple           =  layerscale_value
        __UpperCAmelCase							:	Any           =  use_post_layernorm
        __UpperCAmelCase							:	Optional[Any]           =  use_post_layernorm_in_modulation
        __UpperCAmelCase							:	Union[str, Any]           =  normalize_modulator
        __UpperCAmelCase							:	Optional[int]           =  initializer_range
        __UpperCAmelCase							:	int           =  layer_norm_eps
        __UpperCAmelCase							:	int           =  encoder_stride
        __UpperCAmelCase							:	Optional[int]           =  ["""stem"""] + [f"""stage{idx}""" for idx in range(1		,      len(self.depths					) + 1					)]
        __UpperCAmelCase      , __UpperCAmelCase							:	List[Any]           =  get_aligned_output_features_output_indices(
            out_features=__lowercase		,      out_indices=__lowercase		,      stage_names=self.stage_names					)










from __future__ import annotations

from math import pi






def 				lowerCamelCase__      (    __lowerCamelCase			:     float  ,		__lowerCamelCase			:     float  ,		__lowerCamelCase			:     float		):

  if (inductance, frequency, reactance).count(0		) != 1:
    raise ValueError("""One and only one argument must be 0"""		)
  if inductance < 0:
    raise ValueError("""Inductance cannot be negative"""		)
  if frequency < 0:
    raise ValueError("""Frequency cannot be negative"""		)
  if reactance < 0:
    raise ValueError("""Inductive reactance cannot be negative"""		)
  if inductance == 0:
    return {"inductance": reactance / (2 * pi * frequency)}
  elif frequency == 0:
    return {"frequency": reactance / (2 * pi * inductance)}
  elif reactance == 0:
    return {"reactance": 2 * pi * frequency * inductance}
  else:
    raise ValueError("""Exactly one argument must be 0"""		)


if __name__ == "__main__":
       import doctest

       doctest.testmod()


