



from ..utils import DummyObject, requires_backends





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Any          =['''flax''']






		def __init__(						self      :     Union[str, Any]				,		*UpperCamelCase__      :     str				,		**UpperCamelCase__      :     int      )				->					Union[str, Any]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Union[str, Any]				,		*UpperCamelCase__      :     List[Any]				,		**UpperCamelCase__      :     Optional[Any]      )				->					str:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     List[str]				,		*UpperCamelCase__      :     int				,		**UpperCamelCase__      :     Union[str, Any]      )				->					List[str]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Any          =['''flax''']






		def __init__(						self      :     List[str]				,		*UpperCamelCase__      :     List[Any]				,		**UpperCamelCase__      :     List[Any]      )				->					List[str]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     Optional[int]      )				->					List[Any]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Optional[int]				,		**UpperCamelCase__      :     Optional[int]      )				->					Dict:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Optional[int]          =['''flax''']






		def __init__(						self      :     List[Any]				,		*UpperCamelCase__      :     List[str]				,		**UpperCamelCase__      :     List[Any]      )				->					str:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     List[Any]				,		*UpperCamelCase__      :     Union[str, Any]				,		**UpperCamelCase__      :     Optional[Any]      )				->					str:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Optional[int]				,		**UpperCamelCase__      :     Optional[Any]      )				->					Optional[Any]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Any          =['''flax''']






		def __init__(						self      :     Dict				,		*UpperCamelCase__      :     int				,		**UpperCamelCase__      :     Any      )				->					Union[str, Any]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Dict				,		*UpperCamelCase__      :     int				,		**UpperCamelCase__      :     Tuple      )				->					Tuple:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     List[str]				,		*UpperCamelCase__      :     str				,		**UpperCamelCase__      :     Dict      )				->					int:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Any          =['''flax''']






		def __init__(						self      :     Optional[Any]				,		*UpperCamelCase__      :     Optional[int]				,		**UpperCamelCase__      :     List[Any]      )				->					int:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     int				,		*UpperCamelCase__      :     List[str]				,		**UpperCamelCase__      :     str      )				->					int:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     str				,		*UpperCamelCase__      :     Union[str, Any]				,		**UpperCamelCase__      :     Union[str, Any]      )				->					Tuple:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       List[str]          =['''flax''']






		def __init__(						self      :     Any				,		*UpperCamelCase__      :     int				,		**UpperCamelCase__      :     Tuple      )				->					List[str]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     str				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     Any      )				->					int:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     List[str]				,		**UpperCamelCase__      :     Optional[Any]      )				->					Dict:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Optional[int]          =['''flax''']






		def __init__(						self      :     Optional[int]				,		*UpperCamelCase__      :     Dict				,		**UpperCamelCase__      :     List[str]      )				->					Tuple:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Tuple				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     int      )				->					List[str]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Any				,		**UpperCamelCase__      :     Tuple      )				->					Dict:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       int          =['''flax''']






		def __init__(						self      :     str				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     int      )				->					int:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Union[str, Any]				,		*UpperCamelCase__      :     Union[str, Any]				,		**UpperCamelCase__      :     Optional[Any]      )				->					Dict:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Optional[Any]				,		*UpperCamelCase__      :     List[str]				,		**UpperCamelCase__      :     Optional[Any]      )				->					Union[str, Any]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Dict          =['''flax''']






		def __init__(						self      :     Dict				,		*UpperCamelCase__      :     str				,		**UpperCamelCase__      :     Union[str, Any]      )				->					Optional[Any]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Dict				,		*UpperCamelCase__      :     Optional[Any]				,		**UpperCamelCase__      :     Optional[int]      )				->					Any:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     Dict      )				->					int:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       List[Any]          =['''flax''']






		def __init__(						self      :     Tuple				,		*UpperCamelCase__      :     Optional[Any]				,		**UpperCamelCase__      :     int      )				->					Union[str, Any]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Tuple				,		*UpperCamelCase__      :     Any				,		**UpperCamelCase__      :     Optional[int]      )				->					Optional[int]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Any				,		*UpperCamelCase__      :     Any				,		**UpperCamelCase__      :     Dict      )				->					Tuple:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       Optional[Any]          =['''flax''']






		def __init__(						self      :     int				,		*UpperCamelCase__      :     Optional[Any]				,		**UpperCamelCase__      :     List[Any]      )				->					int:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Optional[Any]				,		*UpperCamelCase__      :     Union[str, Any]				,		**UpperCamelCase__      :     List[str]      )				->					str:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Optional[Any]				,		*UpperCamelCase__      :     str				,		**UpperCamelCase__      :     Optional[Any]      )				->					str:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       str          =['''flax''']






		def __init__(						self      :     Optional[Any]				,		*UpperCamelCase__      :     Any				,		**UpperCamelCase__      :     Union[str, Any]      )				->					List[Any]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Optional[Any]				,		*UpperCamelCase__      :     Any				,		**UpperCamelCase__      :     int      )				->					Tuple:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     Tuple				,		*UpperCamelCase__      :     str				,		**UpperCamelCase__      :     Optional[Any]      )				->					Union[str, Any]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )





class  __magic_name__   (							metaclass=A__						):
		lowercase      :       str          =['''flax''']






		def __init__(						self      :     List[str]				,		*UpperCamelCase__      :     List[Any]				,		**UpperCamelCase__      :     str      )				->					List[str]:
								'''simple docstring'''







								requires_backends(self				,		["flax"]      )






		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     int				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     str      )				->					List[str]:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )







		@classmethod
		def SCREAMING_SNAKE_CASE_			(						cls      :     str				,		*UpperCamelCase__      :     Tuple				,		**UpperCamelCase__      :     Tuple      )				->					str:
								'''simple docstring'''







								requires_backends(cls				,		["flax"]      )








import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation





class  __magic_name__   (							unittest.TestCase						):






		def SCREAMING_SNAKE_CASE_			(						self      :     int      )				->					str:
								'''simple docstring'''







								UpperCAmelCase         =     get_activation("swish"      )

								self.assertIsInstance(UpperCamelCase__				,		nn.SiLU      )

								self.assertEqual(act(torch.tensor(-1_00				,		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      :     Tuple      )				->					List[Any]:
								'''simple docstring'''







								UpperCAmelCase         =     get_activation("silu"      )

								self.assertIsInstance(UpperCamelCase__				,		nn.SiLU      )

								self.assertEqual(act(torch.tensor(-1_00				,		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      :     Optional[Any]      )				->					int:
								'''simple docstring'''







								UpperCAmelCase         =     get_activation("mish"      )

								self.assertIsInstance(UpperCamelCase__				,		nn.Mish      )

								self.assertEqual(act(torch.tensor(-2_00				,		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      :     str      )				->					List[str]:
								'''simple docstring'''







								UpperCAmelCase         =     get_activation("gelu"      )

								self.assertIsInstance(UpperCamelCase__				,		nn.GELU      )

								self.assertEqual(act(torch.tensor(-1_00				,		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      )



