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			(     lowerCAmelCase  ):



 '''simple docstring'''




 __A			       =					'''efficientnet'''







 def __init__(		self				:   Optional[int]							, lowercase_				:   int = 3							, lowercase_				:   int = 600							, 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, 112, 192]							, lowercase_				:   List[int] = [16, 24, 40, 80, 112, 192, 320]							, 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.25							, lowercase_				:   str = "swish"							, lowercase_				:   int = 2560							, lowercase_				:   str = "mean"							, lowercase_				:   float = 0.02							, lowercase_				:   float = 0.0_01							, lowercase_				:   float = 0.99							, lowercase_				:   float = 0.5							, lowercase_				:   float = 0.2							, **lowercase_				:   int							, )						->	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 					_UpperCAmelCase			(     lowerCAmelCase  ):



 '''simple docstring'''




 __A			       =					version.parse('''1.11'''  )







 @property
 def 		__UpperCAmelCase				(		self				:   Union[str, Any])						->	Mapping[str, Mapping[int, str]]:


   """simple docstring"""







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







 @property
 def 		__UpperCAmelCase				(		self				:   Optional[Any])						->	float:


   """simple docstring"""







   return 1e-5





def 				lowerCAmelCase__       (			a__ )      ->int:




  '''simple docstring'''

  if not isinstance(a__    ,     a__ ) or number < 0:
    raise ValueError("Input must be a non-negative integer" )

  _UpperCamelCase           =    0
  while number:
    # This way we arrive at next set bit (next 1) instead of looping
    # through each bit and checking for 1s hence the
    # loop won't run 32 times it will only run the number of `1` times
    number &= number - 1
    count += 1
  return count


if __name__ == "__main__":
   import doctest

   doctest.testmod()




