





'''simple docstring'''




import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation


class 			SCREAMING_SNAKE_CASE   (unittest.TestCase							):


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			Optional[int]								=	get_activation('swish')

          self.assertIsInstance(_UpperCAmelCase						,     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 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			Tuple								=	get_activation('silu')

          self.assertIsInstance(_UpperCAmelCase						,     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 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			int								=	get_activation('mish')

          self.assertIsInstance(_UpperCAmelCase						,     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 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						:			int								=	get_activation('gelu')

          self.assertIsInstance(_UpperCAmelCase						,     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'''




from __future__ import annotations






def 	_lowerCAmelCase      (  __snake_case  :			list[int | str]      )					->					None:
     create_state_space_tree(__snake_case			,							[]			,							0			,							[0 for i in range(len(__snake_case      )      )]      )






def 	_lowerCAmelCase      (  __snake_case  :			list[int | str]			,							__snake_case  :			list[int | str]			,							__snake_case  :			int			,							__snake_case  :			list[int]			,							)					->					None:

     if index == len(__snake_case      ):
          print(__snake_case      )
          return

     for i in range(len(__snake_case      )      ):
          if not index_used[i]:
               current_sequence.append(sequence[i]      )
               __A						:			Any								=	True
               create_state_space_tree(__snake_case			,							__snake_case			,							index + 1			,							__snake_case      )
               current_sequence.pop()
               __A						:			Any								=	False
lowercase__   :				list[int | str]      =   [3, 1, 2, 4]
generate_all_permutations(sequence)

lowercase__   :				list[int | str]      =   ["A", "B", "C"]







generate_all_permutations(sequence_a)