






'''simple docstring'''





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


_UpperCamelCase		:		List[str]            = logging.get_logger(__name__)

_UpperCamelCase		:		Dict            = {
    'microsoft/focalnet-tiny': 'https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json',
}


class       snake_case__	( UpperCamelCase			,							UpperCamelCase):
					a_								= "focalnet"




					def __init__(   self   :						Any							,      _A   :						List[str]=2_24							,      _A   :						Tuple=4							,      _A   :						Any=3							,      _A   :						Tuple=96							,      _A   :						Optional[int]=False							,      _A   :						Optional[int]=[1_92, 3_84, 7_68, 7_68]							,      _A   :						int=[2, 2, 6, 2]							,      _A   :						Optional[int]=[2, 2, 2, 2]							,      _A   :						Tuple=[3, 3, 3, 3]							,      _A   :						Dict="gelu"							,      _A   :						List[Any]=4.0							,      _A   :						Any=0.0							,      _A   :						int=0.1							,      _A   :						Any=False							,      _A   :						Optional[int]=1e-4							,      _A   :						List[Any]=False							,      _A   :						Optional[int]=False							,      _A   :						str=False							,      _A   :						int=0.02							,      _A   :						Tuple=1e-5							,      _A   :						Tuple=32							,      _A   :						Any=None							,      _A   :						Any=None							,      **_A   :						List[str]							,      )  ->				List[str]:
								super().__init__(**_A	)

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





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_									=   {'configuration_xlnet': ['XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XLNetConfig']}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   ['XLNetTokenizer']

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   ['XLNetTokenizerFast']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   [
      'XLNET_PRETRAINED_MODEL_ARCHIVE_LIST',
      'XLNetForMultipleChoice',
      'XLNetForQuestionAnswering',
      'XLNetForQuestionAnsweringSimple',
      'XLNetForSequenceClassification',
      'XLNetForTokenClassification',
      'XLNetLMHeadModel',
      'XLNetModel',
      'XLNetPreTrainedModel',
      'load_tf_weights_in_xlnet',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   [
      'TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST',
      'TFXLNetForMultipleChoice',
      'TFXLNetForQuestionAnsweringSimple',
      'TFXLNetForSequenceClassification',
      'TFXLNetForTokenClassification',
      'TFXLNetLMHeadModel',
      'TFXLNetMainLayer',
      'TFXLNetModel',
      'TFXLNetPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_xlnet import XLNetTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_xlnet_fast import XLNetTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_xlnet import (
        XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        XLNetForMultipleChoice,
        XLNetForQuestionAnswering,
        XLNetForQuestionAnsweringSimple,
        XLNetForSequenceClassification,
        XLNetForTokenClassification,
        XLNetLMHeadModel,
        XLNetModel,
        XLNetPreTrainedModel,
        load_tf_weights_in_xlnet,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_xlnet import (
        TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFXLNetForMultipleChoice,
        TFXLNetForQuestionAnsweringSimple,
        TFXLNetForSequenceClassification,
        TFXLNetForTokenClassification,
        TFXLNetLMHeadModel,
        TFXLNetMainLayer,
        TFXLNetModel,
        TFXLNetPreTrainedModel,
    )

else:
  import sys

  lowercase_									=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


