




from typing import TYPE_CHECKING

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


lowerCamelCase	:	Any				=   {
    '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	:	Optional[int]				=   ['MobileBertTokenizerFast']

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase	:	Any				=   [
           '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	:	Dict				=   [
           '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	:	Optional[Any]				=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)











from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase	:	Optional[int]				=   logging.get_logger(__name__)

lowerCamelCase	:	Tuple				=   {
    'snap-research/efficientformer-l1-300': (
        'https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'
    ),
}




class 						__lowercase		(UpperCamelCase__							):




      """simple docstring"""





      _snake_case												=						"""efficientformer"""

      def __init__(				self    ,				A = [3, 2, 6, 4]    ,				A = [4_8, 9_6, 2_2_4, 4_4_8]    ,				A = [True, True, True, True]    ,				A = 4_4_8    ,				A = 3_2    ,				A = 4    ,				A = 7    ,				A = 5    ,				A = 8    ,				A = 4    ,				A = 0.0    ,				A = 1_6    ,				A = 3    ,				A = 3    ,				A = 3    ,				A = 2    ,				A = 1    ,				A = 0.0    ,				A = 1    ,				A = True    ,				A = True    ,				A = 1e-5    ,				A = "gelu"    ,				A = 0.02    ,				A = 1e-1_2    ,				A = 2_2_4    ,				A = 1e-0_5    ,				**A    ,				)		->    None:
         super().__init__(**A     )

         snake_case				:    Dict           =	hidden_act
         snake_case				:    int           =	hidden_dropout_prob
         snake_case				:    Any           =	hidden_sizes
         snake_case				:    Optional[Any]           =	num_hidden_layers
         snake_case				:    List[Any]           =	num_attention_heads
         snake_case				:    List[Any]           =	initializer_range
         snake_case				:    str           =	layer_norm_eps
         snake_case				:    Dict           =	patch_size
         snake_case				:    Optional[int]           =	num_channels
         snake_case				:    int           =	depths
         snake_case				:    Optional[int]           =	mlp_expansion_ratio
         snake_case				:    Any           =	downsamples
         snake_case				:    Dict           =	dim
         snake_case				:    Optional[int]           =	key_dim
         snake_case				:    Union[str, Any]           =	attention_ratio
         snake_case				:    Any           =	resolution
         snake_case				:    Dict           =	pool_size
         snake_case				:    Any           =	downsample_patch_size
         snake_case				:    Tuple           =	downsample_stride
         snake_case				:    Any           =	downsample_pad
         snake_case				:    Union[str, Any]           =	drop_path_rate
         snake_case				:    List[str]           =	num_metaad_blocks
         snake_case				:    Union[str, Any]           =	distillation
         snake_case				:    List[str]           =	use_layer_scale
         snake_case				:    int           =	layer_scale_init_value
         snake_case				:    Union[str, Any]           =	image_size
         snake_case				:    Dict           =	batch_norm_eps





