



"""simple docstring"""

from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


if TYPE_CHECKING:
	from ... import FeatureExtractionMixin, TensorType

lowercase__			   =  logging.get_logger(__name__)

lowercase__			   =  {
    "openai/imagegpt-small": "",
    "openai/imagegpt-medium": "",
    "openai/imagegpt-large": "",
}




class SCREAMING_SNAKE_CASE__					(		__snake_case      ):
						_lowerCAmelCase							=					"imagegpt"
						_lowerCAmelCase							=					["past_key_values"]
						_lowerCAmelCase							=					{
						    "hidden_size": "n_embd",
						    "max_position_embeddings": "n_positions",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}



						def __init__(self						,     _lowercase=512 + 1						,     _lowercase=32 * 32						,     _lowercase=512						,     _lowercase=24						,     _lowercase=8						,     _lowercase=None						,     _lowercase="quick_gelu"						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=1e-5						,     _lowercase=0.02						,     _lowercase=True						,     _lowercase=True						,     _lowercase=False						,     _lowercase=False						,     _lowercase=False						,     **_lowercase						,     ):





													'''simple docstring'''

													__a		:		Tuple									=       vocab_size
													__a		:		Optional[Any]									=       n_positions
													__a		:		int									=       n_embd
													__a		:		Union[str, Any]									=       n_layer
													__a		:		Optional[int]									=       n_head
													__a		:		Optional[Any]									=       n_inner
													__a		:		int									=       activation_function
													__a		:		List[str]									=       resid_pdrop
													__a		:		Optional[Any]									=       embd_pdrop
													__a		:		List[str]									=       attn_pdrop
													__a		:		Tuple									=       layer_norm_epsilon
													__a		:		Optional[Any]									=       initializer_range
													__a		:		Tuple									=       scale_attn_weights
													__a		:		Optional[Any]									=       use_cache
													__a		:		str									=       scale_attn_by_inverse_layer_idx
													__a		:		int									=       reorder_and_upcast_attn
													__a		:		Union[str, Any]									=       tie_word_embeddings

													super().__init__(tie_word_embeddings=_lowercase						,     **_lowercase							)







class SCREAMING_SNAKE_CASE__					(		__snake_case      ):



						@property
						def     lowerCAmelCase__(self							):





													'''simple docstring'''

													return OrderedDict(
													    [
													        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
													    ]							)





						def     lowerCAmelCase__(self						,     _lowercase						,     _lowercase = 1						,     _lowercase = -1						,     _lowercase = False						,     _lowercase = None						,     _lowercase = 3						,     _lowercase = 32						,     _lowercase = 32						,     ):





													'''simple docstring'''

													__a		:		Union[str, Any]									=       self._generate_dummy_images(_lowercase						,     _lowercase						,     _lowercase						,     _lowercase							)
													__a		:		Union[str, Any]									=       dict(preprocessor(images=_lowercase						,     return_tensors=_lowercase							)							)

													return inputs






"""simple docstring"""

def       __magic_name__    (   _lowerCamelCase				: list[int]					):
							if not nums:  # Makes sure that the list is not empty
														raise ValueError("""List is empty"""					)

							__a		:		Any									=       sum(_lowerCamelCase					) / len(_lowerCamelCase					)  # Calculate the average
							return sum(abs(x - average					) for x in nums					) / len(_lowerCamelCase					)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

