






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

SCREAMING_SNAKE_CASE						:						Optional[Any]					   =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE						:						Dict					   =       {
    '''openai/imagegpt-small''': '''''',
    '''openai/imagegpt-medium''': '''''',
    '''openai/imagegpt-large''': '''''',
}





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Tuple   			=					"""imagegpt"""
	SCREAMING_SNAKE_CASE_:							Tuple   			=					["""past_key_values"""]
	SCREAMING_SNAKE_CASE_:							int   			=					{
	    """hidden_size""": """n_embd""",
	    """max_position_embeddings""": """n_positions""",
	    """num_attention_heads""": """n_head""",
	    """num_hidden_layers""": """n_layer""",
	}


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


					"""simple docstring"""

					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=__a  ,					**__a						)





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	@property
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

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






	def       _UpperCAmelCase						(      self  ,					__a  ,					__a = 1  ,					__a = -1  ,					__a = False  ,					__a = None  ,					__a = 3  ,					__a = 32  ,					__a = 32  ,					):


					"""simple docstring"""

					A__							 =       self._generate_dummy_images(__a  ,					__a  ,					__a  ,					__a						)
					A__							 =       dict(preprocessor(images=__a  ,					return_tensors=__a						)						)

					return inputs










"""simple docstring"""






import numpy as np



def  __lowerCamelCase					(					lowerCAmelCase__				):
				return 1 / (1 + np.exp(-vector				))



def  __lowerCamelCase					(					lowerCAmelCase__				):
				return vector * sigmoid(lowerCAmelCase__				)


if __name__ == "__main__":
					import doctest

					doctest.testmod()


