





import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation




class 							UpperCamelCase_							(       unittest.TestCase		):







 """simple docstring"""

 def 		lowerCamelCase_ (   self							):
       __lowerCamelCase				   =       get_activation("""swish"""							)

       self.assertIsInstance(snake_case_  ,				nn.SiLU							)

       self.assertEqual(act(torch.tensor(-1_0_0  ,				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(2_0  ,				dtype=torch.floataa							)							).item()  ,				2_0							)


 def 		lowerCamelCase_ (   self							):
       __lowerCamelCase				   =       get_activation("""silu"""							)

       self.assertIsInstance(snake_case_  ,				nn.SiLU							)

       self.assertEqual(act(torch.tensor(-1_0_0  ,				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(2_0  ,				dtype=torch.floataa							)							).item()  ,				2_0							)


 def 		lowerCamelCase_ (   self							):
       __lowerCamelCase				   =       get_activation("""mish"""							)

       self.assertIsInstance(snake_case_  ,				nn.Mish							)

       self.assertEqual(act(torch.tensor(-2_0_0  ,				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(2_0  ,				dtype=torch.floataa							)							).item()  ,				2_0							)



 def 		lowerCamelCase_ (   self							):
       __lowerCamelCase				   =       get_activation("""gelu"""							)

       self.assertIsInstance(snake_case_  ,				nn.GELU							)

       self.assertEqual(act(torch.tensor(-1_0_0  ,				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(2_0  ,				dtype=torch.floataa							)							).item()  ,				2_0							)











'''simple docstring'''





def 		__snake_case(							)						->					Optional[Any]:
      for n in range(1	,  1_000_000						):
            yield n * (n + 1) // 2





def 		__snake_case(							_lowerCAmelCase						)						->					str:
      snake_case__    :       Optional[int]       		= 1
      snake_case__    :       List[Any]       		= 2
      while i * i <= n:
            snake_case__    :       Dict       		= 0
            while n % i == 0:
                  n //= i
                  multiplicity += 1
            divisors_count *= multiplicity + 1
            i += 1
      if n > 1:
            divisors_count *= 2
      return divisors_count





def 		__snake_case(							)						->					List[str]:
      return next(i for i in triangle_number_generator() if count_divisors(_lowerCAmelCase						) > 500						)


if __name__ == "__main__":
       print(solution())
