'''simple docstring'''




from typing import List, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...utils import logging


__UpperCAmelCase					=logging.get_logger(__name__)

__UpperCAmelCase					={
    "huggingface/informer-tourism-monthly": (
        "https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json"
    ),
    # See all Informer models at https://huggingface.co/models?filter=informer
}




class        a__ (  UpperCAmelCase__					):
     lowerCamelCase    :	Dict				="informer"
     lowerCamelCase    :	Optional[Any]				={
         "hidden_size": "d_model",
         "num_attention_heads": "encoder_attention_heads",
         "num_hidden_layers": "encoder_layers",
     }






     def __init__(					self						:						Tuple    ,							a						:						Optional[int] = None    ,							a						:						Optional[int] = None    ,							a						:						str = "student_t"    ,							a						:						str = "nll"    ,							a						:						int = 1    ,							a						:						List[int] = None    ,							a						:						Optional[Union[str, bool]] = "mean"    ,							a						:						int = 0    ,							a						:						int = 0    ,							a						:						int = 0    ,							a						:						int = 0    ,							a						:						Optional[List[int]] = None    ,							a						:						Optional[List[int]] = None    ,							a						:						int = 64    ,							a						:						int = 32    ,							a						:						int = 32    ,							a						:						int = 2    ,							a						:						int = 2    ,							a						:						int = 2    ,							a						:						int = 2    ,							a						:						bool = True    ,							a						:						str = "gelu"    ,							a						:						float = 0.05    ,							a						:						float = 0.1    ,							a						:						float = 0.1    ,							a						:						float = 0.1    ,							a						:						float = 0.1    ,							a						:						int = 1_00    ,							a						:						float = 0.02    ,							a						:						List[str]=True    ,							a						:						str = "prob"    ,							a						:						int = 5    ,							a						:						bool = True    ,							**a						:						Tuple    ,							):





         """simple docstring"""



         __lowerCamelCase            =    prediction_length
         __lowerCamelCase            =    context_length or prediction_length
         __lowerCamelCase            =    distribution_output
         __lowerCamelCase            =    loss
         __lowerCamelCase            =    input_size
         __lowerCamelCase            =    num_time_features
         __lowerCamelCase            =    lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
         __lowerCamelCase            =    scaling
         __lowerCamelCase            =    num_dynamic_real_features
         __lowerCamelCase            =    num_static_real_features
         __lowerCamelCase            =    num_static_categorical_features

         # set cardinality
         if cardinality and num_static_categorical_features > 0:
             if len(a       ) != num_static_categorical_features:
                 raise ValueError(
                     '''The cardinality should be a list of the same length as `num_static_categorical_features`'''       )
             __lowerCamelCase            =    cardinality
         else:
             __lowerCamelCase            =    [0]

         # set embedding_dimension
         if embedding_dimension and num_static_categorical_features > 0:
             if len(a       ) != num_static_categorical_features:
                 raise ValueError(
                     '''The embedding dimension should be a list of the same length as `num_static_categorical_features`'''       )
             __lowerCamelCase            =    embedding_dimension
         else:
             __lowerCamelCase            =    [min(50    ,							(cat + 1) // 2       ) for cat in self.cardinality]

         __lowerCamelCase            =    num_parallel_samples

         # Transformer architecture configuration
         __lowerCamelCase            =    input_size * len(self.lags_sequence       ) + self._number_of_features
         __lowerCamelCase            =    d_model
         __lowerCamelCase            =    encoder_attention_heads
         __lowerCamelCase            =    decoder_attention_heads
         __lowerCamelCase            =    encoder_ffn_dim
         __lowerCamelCase            =    decoder_ffn_dim
         __lowerCamelCase            =    encoder_layers
         __lowerCamelCase            =    decoder_layers

         __lowerCamelCase            =    dropout
         __lowerCamelCase            =    attention_dropout
         __lowerCamelCase            =    activation_dropout
         __lowerCamelCase            =    encoder_layerdrop
         __lowerCamelCase            =    decoder_layerdrop

         __lowerCamelCase            =    activation_function
         __lowerCamelCase            =    init_std

         __lowerCamelCase            =    use_cache

         # Informer
         __lowerCamelCase            =    attention_type
         __lowerCamelCase            =    sampling_factor
         __lowerCamelCase            =    distil

         super().__init__(is_encoder_decoder=a    ,							**a       )






     @property
     def   SCREAMING_SNAKE_CASE__  (					self						:						List[Any]       ):





         """simple docstring"""



         return (
             sum(self.embedding_dimension       )
             + self.num_dynamic_real_features
             + self.num_time_features
             + self.num_static_real_features
             + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
         )

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


__UpperCAmelCase					=logging.get_logger(__name__)

__UpperCAmelCase					={
    "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__ (  UpperCAmelCase__					):
     lowerCamelCase    :	Optional[Any]				="levit"






     def __init__(					self						:						Optional[int]    ,							a						:						int=2_24    ,							a						:						Union[str, Any]=3    ,							a						:						List[Any]=3    ,							a						:						Dict=2    ,							a						:						Tuple=1    ,							a						:						Optional[int]=16    ,							a						:						Optional[Any]=[1_28, 2_56, 3_84]    ,							a						:						Dict=[4, 8, 12]    ,							a						:						Optional[Any]=[4, 4, 4]    ,							a						:						Optional[int]=[16, 16, 16]    ,							a						:						Any=0    ,							a						:						List[Any]=[2, 2, 2]    ,							a						:						Optional[Any]=[2, 2, 2]    ,							a						:						Union[str, Any]=0.02    ,							**a						:						Optional[int]    ,							):





         """simple docstring"""



         super().__init__(**a       )
         __lowerCamelCase            =    image_size
         __lowerCamelCase            =    num_channels
         __lowerCamelCase            =    kernel_size
         __lowerCamelCase            =    stride
         __lowerCamelCase            =    padding
         __lowerCamelCase            =    hidden_sizes
         __lowerCamelCase            =    num_attention_heads
         __lowerCamelCase            =    depths
         __lowerCamelCase            =    key_dim
         __lowerCamelCase            =    drop_path_rate
         __lowerCamelCase            =    patch_size
         __lowerCamelCase            =    attention_ratio
         __lowerCamelCase            =    mlp_ratio
         __lowerCamelCase            =    initializer_range
         __lowerCamelCase            =    [
             ['''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__ (  UpperCAmelCase__					):
     lowerCamelCase    :	Tuple				=version.parse("1.11"					)






     @property
     def   SCREAMING_SNAKE_CASE__  (					self						:						Optional[int]       ):





         """simple docstring"""



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






     @property
     def   SCREAMING_SNAKE_CASE__  (					self						:						Union[str, Any]       ):





         """simple docstring"""



         return 1e-4
