






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

_lowerCAmelCase       =				logging.get_logger(__name__)

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



class   SCREAMING_SNAKE_CASE	(					_SCREAMING_SNAKE_CASE    ):





	"""simple docstring"""




	_A							:					str 			=					"""imagegpt"""
	_A							:					List[str] 			=					["""past_key_values"""]
	_A							:					Tuple 			=					{
	    """hidden_size""": """n_embd""",
	    """max_position_embeddings""": """n_positions""",
	    """num_attention_heads""": """n_head""",
	    """num_hidden_layers""": """n_layer""",
	}





	def __init__(self  ,  lowerCAmelCase_=512 + 1  ,  lowerCAmelCase_=32 * 32  ,  lowerCAmelCase_=512  ,  lowerCAmelCase_=24  ,  lowerCAmelCase_=8  ,  lowerCAmelCase_=None  ,  lowerCAmelCase_="quick_gelu"  ,  lowerCAmelCase_=0.1  ,  lowerCAmelCase_=0.1  ,  lowerCAmelCase_=0.1  ,  lowerCAmelCase_=1e-5  ,  lowerCAmelCase_=0.02  ,  lowerCAmelCase_=True  ,  lowerCAmelCase_=True  ,  lowerCAmelCase_=False  ,  lowerCAmelCase_=False  ,  lowerCAmelCase_=False  ,  **lowerCAmelCase_  ,  ):
		A_		:    Dict						     = vocab_size
		A_		:    Any						     = n_positions
		A_		:    Any						     = n_embd
		A_		:    int						     = n_layer
		A_		:    Any						     = n_head
		A_		:    int						     = n_inner
		A_		:    Tuple						     = activation_function
		A_		:    Dict						     = resid_pdrop
		A_		:    str						     = embd_pdrop
		A_		:    str						     = attn_pdrop
		A_		:    int						     = layer_norm_epsilon
		A_		:    Union[str, Any]						     = initializer_range
		A_		:    List[Any]						     = scale_attn_weights
		A_		:    List[str]						     = use_cache
		A_		:    Any						     = scale_attn_by_inverse_layer_idx
		A_		:    Any						     = reorder_and_upcast_attn
		A_		:    Union[str, Any]						     = tie_word_embeddings

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






class   SCREAMING_SNAKE_CASE	(					_SCREAMING_SNAKE_CASE    ):





	"""simple docstring"""




	@property
	def  lowerCamelCase(self				):
		return OrderedDict(
		    [
		        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
		    ]				)





	def  lowerCamelCase(self  ,  lowerCAmelCase_  ,  lowerCAmelCase_ = 1  ,  lowerCAmelCase_ = -1  ,  lowerCAmelCase_ = False  ,  lowerCAmelCase_ = None  ,  lowerCAmelCase_ = 3  ,  lowerCAmelCase_ = 32  ,  lowerCAmelCase_ = 32  ,  ):
		A_		:    int						     = self._generate_dummy_images(lowerCAmelCase_  ,  lowerCAmelCase_  ,  lowerCAmelCase_  ,  lowerCAmelCase_				)
		A_		:    Optional[Any]						     = dict(preprocessor(images=lowerCAmelCase_  ,  return_tensors=lowerCAmelCase_				)				)

		return inputs









"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCAmelCase       =				{
    "configuration_timesformer": ["TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TimesformerConfig"],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							_lowerCAmelCase       =				[
							    "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
							    "TimesformerModel",
							    "TimesformerForVideoClassification",
							    "TimesformerPreTrainedModel",
							]

if TYPE_CHECKING:
							from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_timesformer import (
														    TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    TimesformerForVideoClassification,
														    TimesformerModel,
														    TimesformerPreTrainedModel,
														)

else:
							import sys

							_lowerCAmelCase       =				_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

