
'''simple docstring'''





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


SCREAMING_SNAKE_CASE     =       logging.get_logger(__name__)

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






class 							UpperCAmelCase_							(    A				):

 '''simple docstring'''
 lowercase_					:    Dict				=							"efficientnet"







 def __init__(					self		:  Dict			,				snake_case__		:  int = 3			,				snake_case__		:  int = 6_00			,				snake_case__		:  float = 2.0			,				snake_case__		:  float = 3.1			,				snake_case__		:  int = 8			,				snake_case__		:  List[int] = [3, 3, 5, 3, 5, 5, 3]			,				snake_case__		:  List[int] = [32, 16, 24, 40, 80, 1_12, 1_92]			,				snake_case__		:  List[int] = [16, 24, 40, 80, 1_12, 1_92, 3_20]			,				snake_case__		:  List[int] = []			,				snake_case__		:  List[int] = [1, 2, 2, 2, 1, 2, 1]			,				snake_case__		:  List[int] = [1, 2, 2, 3, 3, 4, 1]			,				snake_case__		:  List[int] = [1, 6, 6, 6, 6, 6, 6]			,				snake_case__		:  float = 0.25			,				snake_case__		:  str = "swish"			,				snake_case__		:  int = 25_60			,				snake_case__		:  str = "mean"			,				snake_case__		:  float = 0.02			,				snake_case__		:  float = 0.001			,				snake_case__		:  float = 0.99			,				snake_case__		:  float = 0.5			,				snake_case__		:  float = 0.2			,				**snake_case__		:  Dict			,				):



   '''simple docstring'''




   super().__init__(**snake_case__ )

   UpperCAmelCase__      :					Any				       =							num_channels
   UpperCAmelCase__      :					str				       =							image_size
   UpperCAmelCase__      :					Tuple				       =							width_coefficient
   UpperCAmelCase__      :					Union[str, Any]				       =							depth_coefficient
   UpperCAmelCase__      :					List[Any]				       =							depth_divisor
   UpperCAmelCase__      :					Any				       =							kernel_sizes
   UpperCAmelCase__      :					int				       =							in_channels
   UpperCAmelCase__      :					Optional[int]				       =							out_channels
   UpperCAmelCase__      :					Optional[Any]				       =							depthwise_padding
   UpperCAmelCase__      :					List[Any]				       =							strides
   UpperCAmelCase__      :					Optional[Any]				       =							num_block_repeats
   UpperCAmelCase__      :					str				       =							expand_ratios
   UpperCAmelCase__      :					Tuple				       =							squeeze_expansion_ratio
   UpperCAmelCase__      :					List[Any]				       =							hidden_act
   UpperCAmelCase__      :					Optional[int]				       =							hidden_dim
   UpperCAmelCase__      :					Any				       =							pooling_type
   UpperCAmelCase__      :					Optional[Any]				       =							initializer_range
   UpperCAmelCase__      :					Any				       =							batch_norm_eps
   UpperCAmelCase__      :					List[Any]				       =							batch_norm_momentum
   UpperCAmelCase__      :					Union[str, Any]				       =							dropout_rate
   UpperCAmelCase__      :					List[Any]				       =							drop_connect_rate
   UpperCAmelCase__      :					int				       =							sum(snake_case__ ) * 4






class 							UpperCAmelCase_							(    A				):

 '''simple docstring'''
 lowercase_					:    Optional[int]				=							version.parse("1.11"				)







 @property
 def 							UpperCamelCase  (					self		:  Optional[Any] ):



   '''simple docstring'''




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







 @property
 def 							UpperCamelCase  (					self		:  Union[str, Any] ):



   '''simple docstring'''




   return 1e-5





'''simple docstring'''





from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE     =       {"""configuration_deit""": ["""DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DeiTConfig""", """DeiTOnnxConfig"""]}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       ["""DeiTFeatureExtractor"""]
      SCREAMING_SNAKE_CASE     =       ["""DeiTImageProcessor"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       [
          """DEIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """DeiTForImageClassification""",
          """DeiTForImageClassificationWithTeacher""",
          """DeiTForMaskedImageModeling""",
          """DeiTModel""",
          """DeiTPreTrainedModel""",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       [
          """TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """TFDeiTForImageClassification""",
          """TFDeiTForImageClassificationWithTeacher""",
          """TFDeiTForMaskedImageModeling""",
          """TFDeiTModel""",
          """TFDeiTPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_deit import DeiTFeatureExtractor
            from .image_processing_deit import DeiTImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_deit import (
                DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DeiTForImageClassification,
                DeiTForImageClassificationWithTeacher,
                DeiTForMaskedImageModeling,
                DeiTModel,
                DeiTPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_deit import (
                TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFDeiTForImageClassification,
                TFDeiTForImageClassificationWithTeacher,
                TFDeiTForMaskedImageModeling,
                TFDeiTModel,
                TFDeiTPreTrainedModel,
            )


else:
      import sys

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



