






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


snake_case__   :						List[str]													=   logging.get_logger(__name__)

snake_case__   :						Optional[Any]													=   {
    """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     _a							(	UpperCAmelCase__     ):






  """simple docstring"""





  A_						       = """trocr"""
  A_						       = ["""past_key_values"""]
  A_						       = {
      """num_attention_heads""": """decoder_attention_heads""",
      """hidden_size""": """d_model""",
      """num_hidden_layers""": """decoder_layers""",
  }




  def __init__(  self		,		_UpperCAmelCase=50265		,		_UpperCAmelCase=1024		,		_UpperCAmelCase=12		,		_UpperCAmelCase=16		,		_UpperCAmelCase=4096		,		_UpperCAmelCase="gelu"		,		_UpperCAmelCase=512		,		_UpperCAmelCase=0.1		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=2		,		_UpperCAmelCase=0.0_2		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=True		,		_UpperCAmelCase=False		,		_UpperCAmelCase=True		,		_UpperCAmelCase=True		,		_UpperCAmelCase=1		,		_UpperCAmelCase=0		,		_UpperCAmelCase=2		,		**_UpperCAmelCase		,		)      ->			str:
     UpperCamelCase_						=  vocab_size
     UpperCamelCase_						=  d_model
     UpperCamelCase_						=  decoder_layers
     UpperCamelCase_						=  decoder_attention_heads
     UpperCamelCase_						=  decoder_ffn_dim
     UpperCamelCase_						=  activation_function
     UpperCamelCase_						=  max_position_embeddings
     UpperCamelCase_						=  dropout
     UpperCamelCase_						=  attention_dropout
     UpperCamelCase_						=  activation_dropout
     UpperCamelCase_						=  init_std
     UpperCamelCase_						=  decoder_layerdrop
     UpperCamelCase_						=  use_cache
     UpperCamelCase_						=  scale_embedding
     UpperCamelCase_						=  use_learned_position_embeddings
     UpperCamelCase_						=  layernorm_embedding

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













import numpy as np






def      _snake_case     (__lowercase):
   return 1 / (1 + np.exp(-vector))






def      _snake_case     (__lowercase):
   return vector * sigmoid(__lowercase)


if __name__ == "__main__":
 import doctest

 doctest.testmod()





