



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


lowerCAmelCase__		:     str       						=logging.get_logger(__name__)

lowerCAmelCase__		:     str       						={
    '''microsoft/markuplm-base''': '''https://huggingface.co/microsoft/markuplm-base/resolve/main/config.json''',
    '''microsoft/markuplm-large''': '''https://huggingface.co/microsoft/markuplm-large/resolve/main/config.json''',
}

class    UpperCAmelCase_  (   UpperCamelCase_       ):

						'''simple docstring'''




						UpperCamelCase__			: Optional[int]				  =  "markuplm"






						def __init__(    self      ,							_A=30_522      ,							_A=768      ,							_A=12      ,							_A=12      ,							_A=3_072      ,							_A="gelu"      ,							_A=0.1      ,							_A=0.1      ,							_A=512      ,							_A=2      ,							_A=0.0_2      ,							_A=1e-12      ,							_A=0      ,							_A=0      ,							_A=2      ,							_A=256      ,							_A=1_024      ,							_A=216      ,							_A=1_001      ,							_A=32      ,							_A=50      ,							_A="absolute"      ,							_A=True      ,							_A=None      ,							**_A      ,							):







													'''simple docstring'''

													super().__init__(
													    pad_token_id=snake_case__      ,							bos_token_id=snake_case__      ,							eos_token_id=snake_case__      ,							**snake_case__      ,							)
													__SCREAMING_SNAKE_CASE									=					vocab_size
													__SCREAMING_SNAKE_CASE									=					hidden_size
													__SCREAMING_SNAKE_CASE									=					num_hidden_layers
													__SCREAMING_SNAKE_CASE									=					num_attention_heads
													__SCREAMING_SNAKE_CASE									=					hidden_act
													__SCREAMING_SNAKE_CASE									=					intermediate_size
													__SCREAMING_SNAKE_CASE									=					hidden_dropout_prob
													__SCREAMING_SNAKE_CASE									=					attention_probs_dropout_prob
													__SCREAMING_SNAKE_CASE									=					max_position_embeddings
													__SCREAMING_SNAKE_CASE									=					type_vocab_size
													__SCREAMING_SNAKE_CASE									=					initializer_range
													__SCREAMING_SNAKE_CASE									=					layer_norm_eps
													__SCREAMING_SNAKE_CASE									=					position_embedding_type
													__SCREAMING_SNAKE_CASE									=					use_cache
													__SCREAMING_SNAKE_CASE									=					classifier_dropout
													# additional properties
													__SCREAMING_SNAKE_CASE									=					max_depth
													__SCREAMING_SNAKE_CASE									=					max_xpath_tag_unit_embeddings
													__SCREAMING_SNAKE_CASE									=					max_xpath_subs_unit_embeddings
													__SCREAMING_SNAKE_CASE									=					tag_pad_id
													__SCREAMING_SNAKE_CASE									=					subs_pad_id
													__SCREAMING_SNAKE_CASE									=					xpath_unit_hidden_size










"""simple docstring"""







import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation


class       SCREAMING_SNAKE_CASE__				(		unittest.TestCase				):
       """simple docstring"""


       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     int								=							get_activation("swish"						)

         self.assertIsInstance(snake_case__		,     nn.SiLU						)

         self.assertEqual(act(torch.tensor(-100		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertNotEqual(act(torch.tensor(-1		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(0		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(20		,     dtype=torch.floataa						)						).item()		,     20						)

       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							get_activation("silu"						)

         self.assertIsInstance(snake_case__		,     nn.SiLU						)

         self.assertEqual(act(torch.tensor(-100		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertNotEqual(act(torch.tensor(-1		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(0		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(20		,     dtype=torch.floataa						)						).item()		,     20						)

       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Dict								=							get_activation("mish"						)

         self.assertIsInstance(snake_case__		,     nn.Mish						)

         self.assertEqual(act(torch.tensor(-200		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertNotEqual(act(torch.tensor(-1		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(0		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(20		,     dtype=torch.floataa						)						).item()		,     20						)







       def        lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							get_activation("gelu"						)

         self.assertIsInstance(snake_case__		,     nn.GELU						)

         self.assertEqual(act(torch.tensor(-100		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertNotEqual(act(torch.tensor(-1		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(0		,     dtype=torch.floataa						)						).item()		,     0						)
         self.assertEqual(act(torch.tensor(20		,     dtype=torch.floataa						)						).item()		,     20						)





