





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

__A							:			Optional[int]         =			logging.get_logger(__name__)

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







class      lowerCamelCase(						__snake_case	):
     '''simple docstring'''


     __magic_name__   =			'imagegpt'
     __magic_name__   =			['past_key_values']
     __magic_name__   =			{
         'hidden_size': 'n_embd',
         'max_position_embeddings': 'n_positions',
         'num_attention_heads': 'n_head',
         'num_hidden_layers': 'n_layer',
     }




     def __init__(    self				,     snake_case_=512 + 1				,     snake_case_=32 * 32				,     snake_case_=512				,     snake_case_=24				,     snake_case_=8				,     snake_case_=None				,     snake_case_="quick_gelu"				,     snake_case_=0.1				,     snake_case_=0.1				,     snake_case_=0.1				,     snake_case_=1E-5				,     snake_case_=0.02				,     snake_case_=True				,     snake_case_=True				,     snake_case_=False				,     snake_case_=False				,     snake_case_=False				,     **snake_case_				,     ):
         _A     =							vocab_size
         _A     =							n_positions
         _A     =							n_embd
         _A     =							n_layer
         _A     =							n_head
         _A     =							n_inner
         _A     =							activation_function
         _A     =							resid_pdrop
         _A     =							embd_pdrop
         _A     =							attn_pdrop
         _A     =							layer_norm_epsilon
         _A     =							initializer_range
         _A     =							scale_attn_weights
         _A     =							use_cache
         _A     =							scale_attn_by_inverse_layer_idx
         _A     =							reorder_and_upcast_attn
         _A     =							tie_word_embeddings

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







class      lowerCamelCase(						__snake_case	):
     '''simple docstring'''


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




     def        lowerCAmelCase__		(    self				,     snake_case_				,     snake_case_ = 1				,     snake_case_ = -1				,     snake_case_ = False				,     snake_case_ = None				,     snake_case_ = 3				,     snake_case_ = 32				,     snake_case_ = 32				,     ):
         _A     =							self._generate_dummy_images(snake_case_				,     snake_case_				,     snake_case_				,     snake_case_							)
         _A     =							dict(preprocessor(images=snake_case_				,     return_tensors=snake_case_							)							)

         return inputs








from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


a_      =     {'configuration_van': ['VAN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VanConfig']}


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			a_      =     [
			    'VAN_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'VanForImageClassification',
			    'VanModel',
			    'VanPreTrainedModel',
			]

if TYPE_CHECKING:
			from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_van import (
						    VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
						    VanForImageClassification,
						    VanModel,
						    VanPreTrainedModel,
						)

else:
			import sys

			a_      =     _LazyModule(__name__, globals()['__file__'], _import_structure)