


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      = logging.get_logger(__name__)

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


class     lowercase__  (					__SCREAMING_SNAKE_CASE		):
  A__=  'efficientnet'






  def __init__(					self      :					int		,						_lowercase      :					int = 3		,						_lowercase      :					int = 6_00		,						_lowercase      :					float = 2.0		,						_lowercase      :					float = 3.1		,						_lowercase      :					int = 8		,						_lowercase      :					List[int] = [3, 3, 5, 3, 5, 5, 3]		,						_lowercase      :					List[int] = [32, 16, 24, 40, 80, 1_12, 1_92]		,						_lowercase      :					List[int] = [16, 24, 40, 80, 1_12, 1_92, 3_20]		,						_lowercase      :					List[int] = []		,						_lowercase      :					List[int] = [1, 2, 2, 2, 1, 2, 1]		,						_lowercase      :					List[int] = [1, 2, 2, 3, 3, 4, 1]		,						_lowercase      :					List[int] = [1, 6, 6, 6, 6, 6, 6]		,						_lowercase      :					float = 0.2_5		,						_lowercase      :					str = "swish"		,						_lowercase      :					int = 25_60		,						_lowercase      :					str = "mean"		,						_lowercase      :					float = 0.0_2		,						_lowercase      :					float = 0.0_0_1		,						_lowercase      :					float = 0.9_9		,						_lowercase      :					float = 0.5		,						_lowercase      :					float = 0.2		,						**_lowercase      :					List[Any]		,						):




         """simple docstring"""







         super().__init__(**_lowercase )

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




class     lowercase__  (					__SCREAMING_SNAKE_CASE		):
  A__=  version.parse('1.11'		)






  @property
  def 			_UpperCAmelCase  (					self      :					Dict ):




         """simple docstring"""







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






  @property
  def 			_UpperCAmelCase  (					self      :					int ):




         """simple docstring"""







         return 1E-5









from .imports import is_tqdm_available


if is_tqdm_available():
    from tqdm.auto import tqdm as _tqdm

from ..state import PartialState





def __UpperCAmelCase       (		__A = True ,						*__A ,						**__A			)						->					Any:



       '''simple docstring'''





       if not is_tqdm_available():
              raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`."			)
       UpperCAmelCase__										=     False
       if main_process_only:
              UpperCAmelCase__										=     PartialState().local_process_index == 0
       return _tqdm(*__A ,						**__A ,						disable=__A			)





