
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowerCamelCase      =logging.get_logger(__name__)

lowerCamelCase      ={
    "sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}




class 				_lowerCamelCase (      UpperCamelCase_ ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE_		   =  '''poolformer'''






     def __init__(							self						,						__SCREAMING_SNAKE_CASE=3						,						__SCREAMING_SNAKE_CASE=1_6						,						__SCREAMING_SNAKE_CASE=1_6						,						__SCREAMING_SNAKE_CASE=3						,						__SCREAMING_SNAKE_CASE=4.0						,						__SCREAMING_SNAKE_CASE=[2, 2, 6, 2]						,						__SCREAMING_SNAKE_CASE=[6_4, 1_2_8, 3_2_0, 5_1_2]						,						__SCREAMING_SNAKE_CASE=[7, 3, 3, 3]						,						__SCREAMING_SNAKE_CASE=[4, 2, 2, 2]						,						__SCREAMING_SNAKE_CASE=[2, 1, 1, 1]						,						__SCREAMING_SNAKE_CASE=4						,						__SCREAMING_SNAKE_CASE=0.0						,						__SCREAMING_SNAKE_CASE="gelu"						,						__SCREAMING_SNAKE_CASE=True						,						__SCREAMING_SNAKE_CASE=1e-5						,						__SCREAMING_SNAKE_CASE=0.02						,						**__SCREAMING_SNAKE_CASE						,						)  ->   str:




           """simple docstring"""







           UpperCamelCase__    :   Optional[int]					=				num_channels
           UpperCamelCase__    :   List[Any]					=				patch_size
           UpperCamelCase__    :   Optional[Any]					=				stride
           UpperCamelCase__    :   Dict					=				padding
           UpperCamelCase__    :   Optional[int]					=				pool_size
           UpperCamelCase__    :   List[str]					=				hidden_sizes
           UpperCamelCase__    :   Tuple					=				mlp_ratio
           UpperCamelCase__    :   List[Any]					=				depths
           UpperCamelCase__    :   Any					=				patch_sizes
           UpperCamelCase__    :   Tuple					=				strides
           UpperCamelCase__    :   Dict					=				num_encoder_blocks
           UpperCamelCase__    :   Optional[Any]					=				drop_path_rate
           UpperCamelCase__    :   Any					=				hidden_act
           UpperCamelCase__    :   Dict					=				use_layer_scale
           UpperCamelCase__    :   Optional[int]					=				layer_scale_init_value
           UpperCamelCase__    :   List[str]					=				initializer_range
           super().__init__(**__SCREAMING_SNAKE_CASE  )




class 				_lowerCamelCase (      UpperCamelCase_ ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE_		   =  version.parse('''1.11''' )






     @property
     def    __SCREAMING_SNAKE_CASE			(							self  )  ->   Mapping[str, Mapping[int, str]]:




           """simple docstring"""







           return OrderedDict(
               [
                   ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
               ]  )






     @property
     def    __SCREAMING_SNAKE_CASE			(							self  )  ->   float:




           """simple docstring"""







           return 2e-3




from typing import TYPE_CHECKING

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


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

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

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCamelCase      =[
        "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:
    lowerCamelCase      =[
        "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

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


