






from typing import TYPE_CHECKING

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


UpperCamelCase								=		{
    "configuration_mobilebert": [
        "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "MobileBertConfig",
        "MobileBertOnnxConfig",
    ],
    "tokenization_mobilebert": ["MobileBertTokenizer"],
}

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase								=		["MobileBertTokenizerFast"]

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase								=		[
							    "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "MobileBertForMaskedLM",
							    "MobileBertForMultipleChoice",
							    "MobileBertForNextSentencePrediction",
							    "MobileBertForPreTraining",
							    "MobileBertForQuestionAnswering",
							    "MobileBertForSequenceClassification",
							    "MobileBertForTokenClassification",
							    "MobileBertLayer",
							    "MobileBertModel",
							    "MobileBertPreTrainedModel",
							    "load_tf_weights_in_mobilebert",
							]

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase								=		[
							    "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TFMobileBertForMaskedLM",
							    "TFMobileBertForMultipleChoice",
							    "TFMobileBertForNextSentencePrediction",
							    "TFMobileBertForPreTraining",
							    "TFMobileBertForQuestionAnswering",
							    "TFMobileBertForSequenceClassification",
							    "TFMobileBertForTokenClassification",
							    "TFMobileBertMainLayer",
							    "TFMobileBertModel",
							    "TFMobileBertPreTrainedModel",
							]


if TYPE_CHECKING:
							from .configuration_mobilebert import (
							    MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    MobileBertConfig,
							    MobileBertOnnxConfig,
							)
							from .tokenization_mobilebert import MobileBertTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_mobilebert_fast import MobileBertTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_mobilebert import (
														    MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    MobileBertForMaskedLM,
														    MobileBertForMultipleChoice,
														    MobileBertForNextSentencePrediction,
														    MobileBertForPreTraining,
														    MobileBertForQuestionAnswering,
														    MobileBertForSequenceClassification,
														    MobileBertForTokenClassification,
														    MobileBertLayer,
														    MobileBertModel,
														    MobileBertPreTrainedModel,
														    load_tf_weights_in_mobilebert,
														)

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_mobilebert import (
														    TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TFMobileBertForMaskedLM,
														    TFMobileBertForMultipleChoice,
														    TFMobileBertForNextSentencePrediction,
														    TFMobileBertForPreTraining,
														    TFMobileBertForQuestionAnswering,
														    TFMobileBertForSequenceClassification,
														    TFMobileBertForTokenClassification,
														    TFMobileBertMainLayer,
														    TFMobileBertModel,
														    TFMobileBertPreTrainedModel,
														)

else:
							import sys

							UpperCamelCase								=		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)












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


lowerCamelCase__       		=  logging.get_logger(__name__)

lowerCamelCase__       		=  {
    """microsoft/focalnet-tiny""": """https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json""",
}




class       snake_case__ (				lowercase_						,     lowercase_):

       '''simple docstring'''
       lowerCamelCase				:					List[Any]								=			"focalnet"



       def __init__(				self      ,    a__=2_24      ,    a__=4      ,    a__=3      ,    a__=96      ,    a__=False      ,    a__=[1_92, 3_84, 7_68, 7_68]      ,    a__=[2, 2, 6, 2]      ,    a__=[2, 2, 2, 2]      ,    a__=[3, 3, 3, 3]      ,    a__="gelu"      ,    a__=4.0      ,    a__=0.0      ,    a__=0.1      ,    a__=False      ,    a__=1e-4      ,    a__=False      ,    a__=False      ,    a__=False      ,    a__=0.02      ,    a__=1e-5      ,    a__=32      ,    a__=None      ,    a__=None      ,    **a__      ,    )			->   Tuple:






            '''simple docstring'''





            super().__init__(**a__     )

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


