



'''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


lowercase_									=    logging.get_logger(__name__)

lowercase_									=    {
    "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     (    A		):



 '''simple docstring'''







 __lowerCamelCase       :			Tuple		=			'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.02					,  **A					,  )       ->	Any:


      """simple docstring"""



      super().__init__(**A			)
      _a           =    image_size
      _a           =    num_channels
      _a           =    kernel_size
      _a           =    stride
      _a           =    padding
      _a           =    hidden_sizes
      _a           =    num_attention_heads
      _a           =    depths
      _a           =    key_dim
      _a           =    drop_path_rate
      _a           =    patch_size
      _a           =    attention_ratio
      _a           =    mlp_ratio
      _a           =    initializer_range
      _a           =    [
          ['''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     (    A		):



 '''simple docstring'''







 __lowerCamelCase       :			str		=			version.parse('1.11'		)



 @property
 def    a__    (self			)       ->	Mapping[str, Mapping[int, str]]:


      """simple docstring"""



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



 @property
 def    a__    (self			)       ->	float:


      """simple docstring"""



      return 1E-4






'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_UpperCamelCase						:  Optional[int]							       =				{
    "configuration_vision_text_dual_encoder": ["VisionTextDualEncoderConfig"],
    "processing_vision_text_dual_encoder": ["VisionTextDualEncoderProcessor"],
}


try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase						:  Dict							       =				["VisionTextDualEncoderModel"]


try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase						:  int							       =				["FlaxVisionTextDualEncoderModel"]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase						:  Tuple							       =				["TFVisionTextDualEncoderModel"]


if TYPE_CHECKING:
     from .configuration_vision_text_dual_encoder import VisionTextDualEncoderConfig
     from .processing_vision_text_dual_encoder import VisionTextDualEncoderProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_vision_text_dual_encoder import VisionTextDualEncoderModel

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_vision_text_dual_encoder import FlaxVisionTextDualEncoderModel

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_vision_text_dual_encoder import TFVisionTextDualEncoderModel


else:
     import sys

     _UpperCamelCase						:  Optional[int]							       =				_LazyModule(__name__, globals()["__file__"], _import_structure)





