




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


_lowerCamelCase      :  str      						=						logging.get_logger(__name__)

_lowerCamelCase      :  List[str]      						=						{
    "microsoft/trocr-base-handwritten": (
        "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json"
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}
class        __snake_case  (__a		):
				lowerCAmelCase__				=     "trocr"
				lowerCAmelCase__				=     ["past_key_values"]
				lowerCAmelCase__				=     {
				    "num_attention_heads": "decoder_attention_heads",
				    "hidden_size": "d_model",
				    "num_hidden_layers": "decoder_layers",
				}



				def __init__(      self      :		int		,	_UpperCAmelCase      :		Tuple=5_0265		,	_UpperCAmelCase      :		List[str]=1024		,	_UpperCAmelCase      :		str=12		,	_UpperCAmelCase      :		int=16		,	_UpperCAmelCase      :		Optional[Any]=4096		,	_UpperCAmelCase      :		List[str]="gelu"		,	_UpperCAmelCase      :		List[Any]=512		,	_UpperCAmelCase      :		List[Any]=0.1		,	_UpperCAmelCase      :		Any=0.0		,	_UpperCAmelCase      :		int=0.0		,	_UpperCAmelCase      :		Any=2		,	_UpperCAmelCase      :		Tuple=0.02		,	_UpperCAmelCase      :		str=0.0		,	_UpperCAmelCase      :		str=True		,	_UpperCAmelCase      :		Union[str, Any]=False		,	_UpperCAmelCase      :		List[Any]=True		,	_UpperCAmelCase      :		Optional[int]=True		,	_UpperCAmelCase      :		Optional[int]=1		,	_UpperCAmelCase      :		Dict=0		,	_UpperCAmelCase      :		List[Any]=2		,	**_UpperCAmelCase      :		str		,	)  ->    Union[str, Any]:





								'''simple docstring'''




								_lowerCAmelCase										=      vocab_size
								_lowerCAmelCase										=      d_model
								_lowerCAmelCase										=      decoder_layers
								_lowerCAmelCase										=      decoder_attention_heads
								_lowerCAmelCase										=      decoder_ffn_dim
								_lowerCAmelCase										=      activation_function
								_lowerCAmelCase										=      max_position_embeddings
								_lowerCAmelCase										=      dropout
								_lowerCAmelCase										=      attention_dropout
								_lowerCAmelCase										=      activation_dropout
								_lowerCAmelCase										=      init_std
								_lowerCAmelCase										=      decoder_layerdrop
								_lowerCAmelCase										=      use_cache
								_lowerCAmelCase										=      scale_embedding
								_lowerCAmelCase										=      use_learned_position_embeddings
								_lowerCAmelCase										=      layernorm_embedding

								super().__init__(
								    pad_token_id=lowerCAmelCase_		,	bos_token_id=lowerCAmelCase_		,	eos_token_id=lowerCAmelCase_		,	decoder_start_token_id=lowerCAmelCase_		,	**lowerCAmelCase_		,	)







import numpy as np




def 							_UpperCAmelCase  (UpperCamelCase_ : np.array       ):
				'''simple docstring'''
				return (2 / (1 + np.exp(-2 * vector       ))) - 1


if __name__ == "__main__":
	import doctest

	doctest.testmod()

