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


__lowerCAmelCase					: List[Any]        =logging.get_logger(__name__)

__lowerCAmelCase					: List[Any]        ={
    """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		( lowerCAmelCase			):
      snake_case__    :     List[str]													=			'levit'

      def __init__(		self	, __lowerCAmelCase=224	, __lowerCAmelCase=3	, __lowerCAmelCase=3	, __lowerCAmelCase=2	, __lowerCAmelCase=1	, __lowerCAmelCase=16	, __lowerCAmelCase=[128, 256, 384]	, __lowerCAmelCase=[4, 8, 12]	, __lowerCAmelCase=[4, 4, 4]	, __lowerCAmelCase=[16, 16, 16]	, __lowerCAmelCase=0	, __lowerCAmelCase=[2, 2, 2]	, __lowerCAmelCase=[2, 2, 2]	, __lowerCAmelCase=0.0_2	, **__lowerCAmelCase	, ):







            """simple docstring"""



            super().__init__(**__lowerCAmelCase		)
            lowercase														=			image_size
            lowercase														=			num_channels
            lowercase														=			kernel_size
            lowercase														=			stride
            lowercase														=			padding
            lowercase														=			hidden_sizes
            lowercase														=			num_attention_heads
            lowercase														=			depths
            lowercase														=			key_dim
            lowercase														=			drop_path_rate
            lowercase														=			patch_size
            lowercase														=			attention_ratio
            lowercase														=			mlp_ratio
            lowercase														=			initializer_range
            lowercase														=			[
                ["""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		( lowerCAmelCase			):
      snake_case__    :     List[str]													=			version.parse('1.11'			)

      @property
      def        A__ (		self		):







            """simple docstring"""



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







      @property
      def        A__ (		self		):







            """simple docstring"""



            return 1E-4







"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__lowerCAmelCase					: Dict        ={
    """configuration_xlm""": ["""XLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """XLMConfig""", """XLMOnnxConfig"""],
    """tokenization_xlm""": ["""XLMTokenizer"""],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase					: int        =[
           """XLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """XLMForMultipleChoice""",
           """XLMForQuestionAnswering""",
           """XLMForQuestionAnsweringSimple""",
           """XLMForSequenceClassification""",
           """XLMForTokenClassification""",
           """XLMModel""",
           """XLMPreTrainedModel""",
           """XLMWithLMHeadModel""",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCAmelCase					: Union[str, Any]        =[
           """TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """TFXLMForMultipleChoice""",
           """TFXLMForQuestionAnsweringSimple""",
           """TFXLMForSequenceClassification""",
           """TFXLMForTokenClassification""",
           """TFXLMMainLayer""",
           """TFXLMModel""",
           """TFXLMPreTrainedModel""",
           """TFXLMWithLMHeadModel""",
       ]


if TYPE_CHECKING:
       from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
       from .tokenization_xlm import XLMTokenizer

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_xlm import (
                  XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XLMForMultipleChoice,
                  XLMForQuestionAnswering,
                  XLMForQuestionAnsweringSimple,
                  XLMForSequenceClassification,
                  XLMForTokenClassification,
                  XLMModel,
                  XLMPreTrainedModel,
                  XLMWithLMHeadModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_xlm import (
                  TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFXLMForMultipleChoice,
                  TFXLMForQuestionAnsweringSimple,
                  TFXLMForSequenceClassification,
                  TFXLMForTokenClassification,
                  TFXLMMainLayer,
                  TFXLMModel,
                  TFXLMPreTrainedModel,
                  TFXLMWithLMHeadModel,
              )

else:
       import sys

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



