



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


lowerCAmelCase__		:     Tuple       						=logging.get_logger(__name__)

lowerCAmelCase__		:     Tuple       						={
    '''MIT/ast-finetuned-audioset-10-10-0.4593''': (
        '''https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json'''
    ),
}

class    UpperCAmelCase_  (   UpperCamelCase_       ):

						'''simple docstring'''




						UpperCamelCase__			: Union[str, Any]				  =  "audio-spectrogram-transformer"






						def __init__(    self      ,							_A=768      ,							_A=12      ,							_A=12      ,							_A=3_072      ,							_A="gelu"      ,							_A=0.0      ,							_A=0.0      ,							_A=0.0_2      ,							_A=1e-12      ,							_A=16      ,							_A=True      ,							_A=10      ,							_A=10      ,							_A=1_024      ,							_A=128      ,							**_A      ,							):







													'''simple docstring'''

													super().__init__(**snake_case__		)

													__SCREAMING_SNAKE_CASE									=					hidden_size
													__SCREAMING_SNAKE_CASE									=					num_hidden_layers
													__SCREAMING_SNAKE_CASE									=					num_attention_heads
													__SCREAMING_SNAKE_CASE									=					intermediate_size
													__SCREAMING_SNAKE_CASE									=					hidden_act
													__SCREAMING_SNAKE_CASE									=					hidden_dropout_prob
													__SCREAMING_SNAKE_CASE									=					attention_probs_dropout_prob
													__SCREAMING_SNAKE_CASE									=					initializer_range
													__SCREAMING_SNAKE_CASE									=					layer_norm_eps
													__SCREAMING_SNAKE_CASE									=					patch_size
													__SCREAMING_SNAKE_CASE									=					qkv_bias
													__SCREAMING_SNAKE_CASE									=					frequency_stride
													__SCREAMING_SNAKE_CASE									=					time_stride
													__SCREAMING_SNAKE_CASE									=					max_length
													__SCREAMING_SNAKE_CASE									=					num_mel_bins










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





