


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


_SCREAMING_SNAKE_CASE     :					int      =       logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE     :					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__   (       snake_case__      ):







    """simple docstring"""

    __magic_name__         =						'levit'
    def __init__(			self     ,   __snake_case=2_2_4     ,   __snake_case=3     ,   __snake_case=3     ,   __snake_case=2     ,   __snake_case=1     ,   __snake_case=1_6     ,   __snake_case=[1_2_8, 2_5_6, 3_8_4]     ,   __snake_case=[4, 8, 1_2]     ,   __snake_case=[4, 4, 4]     ,   __snake_case=[1_6, 1_6, 1_6]     ,   __snake_case=0     ,   __snake_case=[2, 2, 2]     ,   __snake_case=[2, 2, 2]     ,   __snake_case=0.02     ,   **__snake_case     ,   ):
         super().__init__(**__snake_case       )
         snake_case											=							image_size
         snake_case											=							num_channels
         snake_case											=							kernel_size
         snake_case											=							stride
         snake_case											=							padding
         snake_case											=							hidden_sizes
         snake_case											=							num_attention_heads
         snake_case											=							depths
         snake_case											=							key_dim
         snake_case											=							drop_path_rate
         snake_case											=							patch_size
         snake_case											=							attention_ratio
         snake_case											=							mlp_ratio
         snake_case											=							initializer_range
         snake_case											=							[
             ['''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__   (       snake_case__      ):







    """simple docstring"""

    __magic_name__         =						version.parse('1.11'      )
    @property
    def 						a_     (			self       ):
         return OrderedDict(
             [
                 ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
             ]       )




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








from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
 from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline




