





'''simple docstring'''


import unittest

import torch
from torch import nn

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





     def 							lowercase__      ( self		:					Tuple						):





        """simple docstring"""




        lowercase_			:Optional[Any]    			= get_activation("swish"						)

        self.assertIsInstance(lowercase	,      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		:					int						):





        """simple docstring"""




        lowercase_			:Optional[int]    			= get_activation("silu"						)

        self.assertIsInstance(lowercase	,      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		:					str						):





        """simple docstring"""




        lowercase_			:Dict    			= get_activation("mish"						)

        self.assertIsInstance(lowercase	,      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		:					Optional[int]						):





        """simple docstring"""




        lowercase_			:List[str]    			= get_activation("gelu"						)

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









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase					:					int = 1_00 ):
   lowercase_			:Tuple    			= n * (n + 1) * (2 * n + 1) / 6
   lowercase_			:List[str]    			= (n * (n + 1) / 2) ** 2
   return int(square_of_sum - sum_of_squares )


if __name__ == "__main__":
 print(F'''{solution() = }''')


