



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


a_   :Dict        =      logging.get_logger(__name__)

a_   :Optional[int]        =      {
    "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json",
}




class 					snake_case__						(       lowerCAmelCase_     ):






     """simple docstring"""


     _SCREAMING_SNAKE_CASE						=	"""efficientnet"""






     def __init__(       self  :  List[str], _snake_case  :  int = 3, _snake_case  :  int = 6_0_0, _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] = [3_2, 1_6, 2_4, 4_0, 8_0, 1_1_2, 1_9_2], _snake_case  :  List[int] = [1_6, 2_4, 4_0, 8_0, 1_1_2, 1_9_2, 3_2_0], _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.2_5, _snake_case  :  str = "swish", _snake_case  :  int = 2_5_6_0, _snake_case  :  str = "mean", _snake_case  :  float = 0.0_2, _snake_case  :  float = 0.0_0_1, _snake_case  :  float = 0.9_9, _snake_case  :  float = 0.5, _snake_case  :  float = 0.2, **_snake_case  :  List[str], )   ->Tuple:
            super().__init__(**_snake_case					)

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




class 					snake_case__						(       lowerCAmelCase_     ):






     """simple docstring"""


     _SCREAMING_SNAKE_CASE						=	version.parse("""1.11"""     )






     @property
     def    lowercase_   (       self  :  Optional[int]					)   ->Mapping[str, Mapping[int, str]]:
            return OrderedDict(
                [
                    ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
                ]					)






     @property
     def    lowercase_   (       self  :  List[Any]					)   ->float:
            return 1e-5











from typing import TYPE_CHECKING

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


a_   :Optional[Any]        =      {"configuration_reformer": ["REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "ReformerConfig"]}

try:
 if not is_sentencepiece_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :str        =      ["ReformerTokenizer"]

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :int        =      ["ReformerTokenizerFast"]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   :List[str]        =      [
     "REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ReformerAttention",
     "ReformerForMaskedLM",
     "ReformerForQuestionAnswering",
     "ReformerForSequenceClassification",
     "ReformerLayer",
     "ReformerModel",
     "ReformerModelWithLMHead",
     "ReformerPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

 try:
  if not is_sentencepiece_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_reformer import ReformerTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_reformer_fast import ReformerTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_reformer import (
      REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
      ReformerAttention,
      ReformerForMaskedLM,
      ReformerForQuestionAnswering,
      ReformerForSequenceClassification,
      ReformerLayer,
      ReformerModel,
      ReformerModelWithLMHead,
      ReformerPreTrainedModel,
  )

else:
 import sys

 a_   :Optional[Any]        =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






