




from typing import List, Optional, Union

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


__A								=       logging.get_logger(__name__)

__A								=       {
    "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        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







			snake_case_  						=			'''informer'''
			snake_case_  						=			{
			    '''hidden_size''': '''d_model''',
			    '''num_attention_heads''': '''encoder_attention_heads''',
			    '''num_hidden_layers''': '''encoder_layers''',
			}


			def __init__( self     ,		lowerCamelCase__ = None     ,		lowerCamelCase__ = None     ,		lowerCamelCase__ = "student_t"     ,		lowerCamelCase__ = "nll"     ,		lowerCamelCase__ = 1     ,		lowerCamelCase__ = None     ,		lowerCamelCase__ = "mean"     ,		lowerCamelCase__ = 0     ,		lowerCamelCase__ = 0     ,		lowerCamelCase__ = 0     ,		lowerCamelCase__ = 0     ,		lowerCamelCase__ = None     ,		lowerCamelCase__ = None     ,		lowerCamelCase__ = 64     ,		lowerCamelCase__ = 32     ,		lowerCamelCase__ = 32     ,		lowerCamelCase__ = 2     ,		lowerCamelCase__ = 2     ,		lowerCamelCase__ = 2     ,		lowerCamelCase__ = 2     ,		lowerCamelCase__ = True     ,		lowerCamelCase__ = "gelu"     ,		lowerCamelCase__ = 0.05     ,		lowerCamelCase__ = 0.1     ,		lowerCamelCase__ = 0.1     ,		lowerCamelCase__ = 0.1     ,		lowerCamelCase__ = 0.1     ,		lowerCamelCase__ = 100     ,		lowerCamelCase__ = 0.02     ,		lowerCamelCase__=True     ,		lowerCamelCase__ = "prob"     ,		lowerCamelCase__ = 5     ,		lowerCamelCase__ = True     ,		**lowerCamelCase__     ,		)       -> str:



							'''simple docstring'''
							# time series specific configuration
							__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(lowerCamelCase__				) != 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(lowerCamelCase__				) != 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=lowerCamelCase__     ,		**lowerCamelCase__				)






			@property
			def  lowercase_       ( self				)       -> int:



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








# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from argparse import ArgumentParser

from accelerate.commands.config import get_config_parser
from accelerate.commands.env import env_command_parser
from accelerate.commands.launch import launch_command_parser
from accelerate.commands.test import test_command_parser
from accelerate.commands.tpu import tpu_command_parser







def      lowerCamelCase_						(			)	->			Union[str, Any]:





				"""simple docstring"""


				__lowerCamelCase									=       ArgumentParser('Accelerate CLI tool'					,	usage='accelerate <command> [<args>]'					,	allow_abbrev=UpperCamelCase__ )
				__lowerCamelCase									=       parser.add_subparsers(help='accelerate command helpers' )

				# Register commands
				get_config_parser(subparsers=UpperCamelCase__ )
				env_command_parser(subparsers=UpperCamelCase__ )
				launch_command_parser(subparsers=UpperCamelCase__ )
				tpu_command_parser(subparsers=UpperCamelCase__ )
				test_command_parser(subparsers=UpperCamelCase__ )

				# Let's go
				__lowerCamelCase									=       parser.parse_args()

				if not hasattr(UpperCamelCase__					,	'func' ):
								parser.print_help()
								exit(1 )

				# Run
				args.func(UpperCamelCase__ )


if __name__ == "__main__":
					main()


