





'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

from packaging import version

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


_A:					Optional[int]							=				logging.get_logger(__name__)

_A:					str							=				{
    """facebook/levit-128S""": """https://huggingface.co/facebook/levit-128S/resolve/main/config.json""",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}






class UpperCAmelCase							(		UpperCAmelCase_							):
    _A :			Any						   =       """levit"""



    def __init__(  self     ,			__A=224     ,			__A=3     ,			__A=3     ,			__A=2     ,			__A=1     ,			__A=16     ,			__A=[128, 256, 384]     ,			__A=[4, 8, 12]     ,			__A=[4, 4, 4]     ,			__A=[16, 16, 16]     ,			__A=0     ,			__A=[2, 2, 2]     ,			__A=[2, 2, 2]     ,			__A=0.0_2     ,			**__A     ,			):
     super().__init__(**__A					)
     __UpperCAmelCase					=   image_size
     __UpperCAmelCase					=   num_channels
     __UpperCAmelCase					=   kernel_size
     __UpperCAmelCase					=   stride
     __UpperCAmelCase					=   padding
     __UpperCAmelCase					=   hidden_sizes
     __UpperCAmelCase					=   num_attention_heads
     __UpperCAmelCase					=   depths
     __UpperCAmelCase					=   key_dim
     __UpperCAmelCase					=   drop_path_rate
     __UpperCAmelCase					=   patch_size
     __UpperCAmelCase					=   attention_ratio
     __UpperCAmelCase					=   mlp_ratio
     __UpperCAmelCase					=   initializer_range
     __UpperCAmelCase					=   [
         ['Subsample', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
         ['Subsample', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
     ]






class UpperCAmelCase							(		UpperCAmelCase_							):
    _A :			Any						   =       version.parse("""1.11"""							)



    @property
    def 					__lowerCamelCase						(  self					):
     return OrderedDict(
         [
             ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
         ]					)




    @property
    def 					__lowerCamelCase						(  self					):
     return 1E-4












'''simple docstring'''




from __future__ import annotations







def _lowerCAmelCase     (      _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase       ,    )->     tuple:
 if (electron_conc, hole_conc, intrinsic_conc).count(0    ) != 1:
  raise ValueError('You cannot supply more or less than 2 values'    )
 elif electron_conc < 0:
  raise ValueError('Electron concentration cannot be negative in a semiconductor'    )
 elif hole_conc < 0:
  raise ValueError('Hole concentration cannot be negative in a semiconductor'    )
 elif intrinsic_conc < 0:
  raise ValueError(
      'Intrinsic concentration cannot be negative in a semiconductor'    )
 elif electron_conc == 0:
  return (
      "electron_conc",
      intrinsic_conc**2 / hole_conc,
  )
 elif hole_conc == 0:
  return (
      "hole_conc",
      intrinsic_conc**2 / electron_conc,
  )
 elif intrinsic_conc == 0:
  return (
      "intrinsic_conc",
      (electron_conc * hole_conc) ** 0.5,
  )
 else:
  return (-1, -1)


if __name__ == "__main__":
    import doctest

    doctest.testmod()





