






"""simple docstring"""

import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch


if is_torch_available():
			import torch

			from transformers.activations import gelu_new, gelu_python, get_activation

@require_torch
class 						A_							(      unittest.TestCase  ):







				def     _snake_case					(							self							:						str	)				->					Optional[Any]:
										__magic_name__     :   Optional[Any]            =     torch.tensor([-1_0_0, -1, -0.1, 0, 0.1, 1.0, 1_0_0]	)
										__magic_name__     :   int            =     get_activation("gelu"	)
										self.assertTrue(torch.allclose(gelu_python(UpperCamelCase_	)						,    torch_builtin(UpperCamelCase_	)	)	)
										self.assertFalse(torch.allclose(gelu_python(UpperCamelCase_	)						,    gelu_new(UpperCamelCase_	)	)	)







				def     _snake_case					(							self							:						str	)				->					int:
										__magic_name__     :   int            =     torch.tensor([-1_0_0, -1, -0.1, 0, 0.1, 1.0, 1_0_0]	)
										__magic_name__     :   List[Any]            =     get_activation("gelu"	)
										__magic_name__     :   str            =     get_activation("gelu_10"	)

										__magic_name__     :   str            =     torch_builtin(UpperCamelCase_	)
										__magic_name__     :   Dict            =     geluaa(UpperCamelCase_	)

										__magic_name__     :   Optional[Any]            =     torch.where(y_gelu_aa < 10.0						,    1						,    0	)

										self.assertTrue(torch.max(UpperCamelCase_	).item() == 10.0	)
										self.assertTrue(torch.allclose(y_gelu * clipped_mask						,    y_gelu_aa * clipped_mask	)	)







				def     _snake_case					(							self							:						str	)				->					Any:
										get_activation("gelu"	)
										get_activation("gelu_10"	)
										get_activation("gelu_fast"	)
										get_activation("gelu_new"	)
										get_activation("gelu_python"	)
										get_activation("gelu_pytorch_tanh"	)
										get_activation("linear"	)
										get_activation("mish"	)
										get_activation("quick_gelu"	)
										get_activation("relu"	)
										get_activation("sigmoid"	)
										get_activation("silu"	)
										get_activation("swish"	)
										get_activation("tanh"	)
										with self.assertRaises(UpperCamelCase_	):
																get_activation("bogus"	)
										with self.assertRaises(UpperCamelCase_	):
																get_activation(UpperCamelCase_	)







				def     _snake_case					(							self							:						List[Any]	)				->					Optional[Any]:
										__magic_name__     :   Optional[int]            =     get_activation("gelu"	)
										__magic_name__     :   Tuple            =     1
										__magic_name__     :   Optional[Any]            =     get_activation("gelu"	)
										self.assertEqual(acta.a						,    1	)
										with self.assertRaises(UpperCamelCase_	):
																__magic_name__     :   str            =     acta.a











"""simple docstring"""

def _lowerCAmelCase	(  __lowerCamelCase:int   ):

						'''simple docstring'''






						__magic_name__            =     n ** (1 / 3)
						return (val * val * val) == n


if __name__ == "__main__":
			print(perfect_cube(27))
			print(perfect_cube(4))



