



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


lowercase      :   Optional[int]      =       {
    """configuration_pegasus_x""": ["""PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PegasusXConfig"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase      :   int      =       [
          """PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """PegasusXForConditionalGeneration""",
          """PegasusXModel""",
          """PegasusXPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_pegasus_x import PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusXConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_pegasus_x import (
                PEGASUS_X_PRETRAINED_MODEL_ARCHIVE_LIST,
                PegasusXForConditionalGeneration,
                PegasusXModel,
                PegasusXPreTrainedModel,
            )


else:
      import sys

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



