




import logging

from transformers import PretrainedConfig


UpperCamelCase__    			=			logging.getLogger(__name__)


UpperCamelCase__    			=			{
    """bertabs-finetuned-cnndm""": """https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json""",
}
class 			a__    (					snake_case__      ):
						_a							:    Optional[int]					=    """bertabs"""






						def __init__(   self		,			_A=3_0_5_2_2		,			_A=5_1_2		,			_A=6		,			_A=5_1_2		,			_A=8		,			_A=5_1_2		,			_A=0.2		,			_A=6		,			_A=7_6_8		,			_A=8		,			_A=2_0_4_8		,			_A=0.2		,			**_A		,			):




											"""simple docstring"""



											super().__init__(**_A			)

											__lowerCAmelCase				   =       vocab_size
											__lowerCAmelCase				   =       max_pos

											__lowerCAmelCase				   =       enc_layers
											__lowerCAmelCase				   =       enc_hidden_size
											__lowerCAmelCase				   =       enc_heads
											__lowerCAmelCase				   =       enc_ff_size
											__lowerCAmelCase				   =       enc_dropout

											__lowerCAmelCase				   =       dec_layers
											__lowerCAmelCase				   =       dec_hidden_size
											__lowerCAmelCase				   =       dec_heads
											__lowerCAmelCase				   =       dec_ff_size
											__lowerCAmelCase				   =       dec_dropout








"""simple docstring"""




import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation
class 					__lowerCAmelCase					(   unittest.TestCase       ):


		'''simple docstring'''



		def 			__UpperCAmelCase       (  self      ):
				__a           =			get_activation('''swish'''      )

				self.assertIsInstance(_a							, 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 			__UpperCAmelCase       (  self      ):
				__a           =			get_activation('''silu'''      )

				self.assertIsInstance(_a							, 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 			__UpperCAmelCase       (  self      ):
				__a           =			get_activation('''mish'''      )

				self.assertIsInstance(_a							, 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 			__UpperCAmelCase       (  self      ):
				__a           =			get_activation('''gelu'''      )

				self.assertIsInstance(_a							, 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      )






