





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


__lowercase  :   Any						      =logging.get_logger(__name__)

__lowercase  :   List[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      A       (	__lowercase						):
      _snake_case							     ='''levit'''



      def __init__(	self:						Dict		,  _lowerCAmelCase:						Optional[int]=224		,  _lowerCAmelCase:						Dict=3		,  _lowerCAmelCase:						int=3		,  _lowerCAmelCase:						Union[str, Any]=2		,  _lowerCAmelCase:						Union[str, Any]=1		,  _lowerCAmelCase:						List[str]=16		,  _lowerCAmelCase:						int=[128, 256, 384]		,  _lowerCAmelCase:						List[Any]=[4, 8, 12]		,  _lowerCAmelCase:						int=[4, 4, 4]		,  _lowerCAmelCase:						List[str]=[16, 16, 16]		,  _lowerCAmelCase:						Optional[Any]=0		,  _lowerCAmelCase:						Optional[Any]=[2, 2, 2]		,  _lowerCAmelCase:						Tuple=[2, 2, 2]		,  _lowerCAmelCase:						Union[str, Any]=0.02		,  **_lowerCAmelCase:						Tuple		,  )						->    Tuple:
         '''simple docstring'''

         super().__init__(**_lowerCAmelCase       )
         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      A       (	__lowercase						):
      _snake_case							     =version.parse('''1.11'''						)



      @property
      def 	lowerCAmelCase__    (	self:						str       )						->    Mapping[str, Mapping[int, str]]:
         '''simple docstring'''

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






      @property
      def 	lowerCAmelCase__    (	self:						Tuple       )						->    float:
         '''simple docstring'''

         return 1e-4











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowercase  :   Any						      ={
    """configuration_upernet""": ["""UperNetConfig"""],
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __lowercase  :   Tuple						      =[
         """UperNetForSemanticSegmentation""",
         """UperNetPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_upernet import UperNetConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_upernet import UperNetForSemanticSegmentation, UperNetPreTrainedModel


else:
     import sys

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




