





from collections import OrderedDict
from typing import List, Mapping

from packaging import version

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


_lowerCamelCase 					=      logging.get_logger(__name__)

_lowerCamelCase 					=      {
    'google/efficientnet-b7': 'https://huggingface.co/google/efficientnet-b7/resolve/main/config.json',
}




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "efficientnet"


							def __init__(				self     :Tuple				,					__A     :int = 3				,					__A     :int = 600				,					__A     :float = 2.0				,					__A     :float = 3.1				,					__A     :int = 8				,					__A     :List[int] = [3, 3, 5, 3, 5, 5, 3]				,					__A     :List[int] = [32, 16, 24, 40, 80, 112, 192]				,					__A     :List[int] = [16, 24, 40, 80, 112, 192, 320]				,					__A     :List[int] = []				,					__A     :List[int] = [1, 2, 2, 2, 1, 2, 1]				,					__A     :List[int] = [1, 2, 2, 3, 3, 4, 1]				,					__A     :List[int] = [1, 6, 6, 6, 6, 6, 6]				,					__A     :float = 0.2_5				,					__A     :str = "swish"				,					__A     :int = 2560				,					__A     :str = "mean"				,					__A     :float = 0.0_2				,					__A     :float = 0.0_0_1				,					__A     :float = 0.9_9				,					__A     :float = 0.5				,					__A     :float = 0.2				,					**__A     :int				,					) -> List[Any]:



									"""simple docstring"""



									super().__init__(**__A		)

									SCREAMING_SNAKE_CASE__								=   num_channels
									SCREAMING_SNAKE_CASE__								=   image_size
									SCREAMING_SNAKE_CASE__								=   width_coefficient
									SCREAMING_SNAKE_CASE__								=   depth_coefficient
									SCREAMING_SNAKE_CASE__								=   depth_divisor
									SCREAMING_SNAKE_CASE__								=   kernel_sizes
									SCREAMING_SNAKE_CASE__								=   in_channels
									SCREAMING_SNAKE_CASE__								=   out_channels
									SCREAMING_SNAKE_CASE__								=   depthwise_padding
									SCREAMING_SNAKE_CASE__								=   strides
									SCREAMING_SNAKE_CASE__								=   num_block_repeats
									SCREAMING_SNAKE_CASE__								=   expand_ratios
									SCREAMING_SNAKE_CASE__								=   squeeze_expansion_ratio
									SCREAMING_SNAKE_CASE__								=   hidden_act
									SCREAMING_SNAKE_CASE__								=   hidden_dim
									SCREAMING_SNAKE_CASE__								=   pooling_type
									SCREAMING_SNAKE_CASE__								=   initializer_range
									SCREAMING_SNAKE_CASE__								=   batch_norm_eps
									SCREAMING_SNAKE_CASE__								=   batch_norm_momentum
									SCREAMING_SNAKE_CASE__								=   dropout_rate
									SCREAMING_SNAKE_CASE__								=   drop_connect_rate
									SCREAMING_SNAKE_CASE__								=   sum(__A		) * 4




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       version.parse("1.11"     )


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



									"""simple docstring"""



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


							@property
							def   _snake_case	(				self     :List[str]		) -> float:



									"""simple docstring"""



									return 1E-5
'''simple docstring'''




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__)
