
'''simple docstring'''







import unittest

import torch
from torch import nn

from diffusers.models.activations import get_activation






class 			lowerCAmelCase__       (  unittest.TestCase					):






					def      _snake_case   (       self		):


											"""simple docstring"""





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

											self.assertIsInstance(__SCREAMING_SNAKE_CASE    ,							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      _snake_case   (       self		):


											"""simple docstring"""





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

											self.assertIsInstance(__SCREAMING_SNAKE_CASE    ,							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      _snake_case   (       self		):


											"""simple docstring"""





											lowercase_     :					Union[str, Any]													=	get_activation('''mish'''		)

											self.assertIsInstance(__SCREAMING_SNAKE_CASE    ,							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      _snake_case   (       self		):


											"""simple docstring"""





											lowercase_     :					Tuple													=	get_activation('''gelu'''		)

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





'''simple docstring'''







def  snake_case_		(    __SCREAMING_SNAKE_CASE :			int				,				__SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float							):



						"""simple docstring"""





						return round(float(moles / volume							) * nfactor							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float							):



						"""simple docstring"""





						return round(float((moles * 0.0821 * temperature) / (volume)							)							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float							):



						"""simple docstring"""





						return round(float((moles * 0.0821 * temperature) / (pressure)							)							)
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			float							):



						"""simple docstring"""





						return round(float((pressure * volume) / (0.0821 * moles)							)							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()



