

"""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       snake_case__  ( unittest.TestCase     ):







			def 			__lowerCAmelCase				(			self			: List[str]  ):





								'''simple docstring'''



								UpperCAmelCase			:   Tuple      =				torch.tensor([-1_00, -1, -0.1, 0, 0.1, 1.0, 1_00]  )
								UpperCAmelCase			:   List[Any]      =				get_activation("gelu"  )
								self.assertTrue(torch.allclose(gelu_python(lowercase  )			,  torch_builtin(lowercase  )  )  )
								self.assertFalse(torch.allclose(gelu_python(lowercase  )			,  gelu_new(lowercase  )  )  )







			def 			__lowerCAmelCase				(			self			: Dict  ):





								'''simple docstring'''



								UpperCAmelCase			:   Tuple      =				torch.tensor([-1_00, -1, -0.1, 0, 0.1, 1.0, 1_00]  )
								UpperCAmelCase			:   str      =				get_activation("gelu"  )
								UpperCAmelCase			:   int      =				get_activation("gelu_10"  )

								UpperCAmelCase			:   Optional[int]      =				torch_builtin(lowercase  )
								UpperCAmelCase			:   Tuple      =				geluaa(lowercase  )

								UpperCAmelCase			:   Dict      =				torch.where(y_gelu_aa < 1_0.0			,  1			,  0  )

								self.assertTrue(torch.max(lowercase  ).item() == 1_0.0  )
								self.assertTrue(torch.allclose(y_gelu * clipped_mask			,  y_gelu_aa * clipped_mask  )  )







			def 			__lowerCAmelCase				(			self			: Dict  ):





								'''simple docstring'''



								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(lowercase  ):
													get_activation("bogus"  )
								with self.assertRaises(lowercase  ):
													get_activation(lowercase  )







			def 			__lowerCAmelCase				(			self			: Optional[int]  ):





								'''simple docstring'''



								UpperCAmelCase			:   str      =				get_activation("gelu"  )
								UpperCAmelCase			:   List[str]      =				1
								UpperCAmelCase			:   Optional[Any]      =				get_activation("gelu"  )
								self.assertEqual(acta.a			,  1  )
								with self.assertRaises(lowercase  ):
													UpperCAmelCase			:   str      =				acta.a





"""simple docstring"""






snake_case_   :   str        =       [
    """DownloadConfig""",
    """DownloadManager""",
    """DownloadMode""",
    """StreamingDownloadManager""",
]

from .download_config import DownloadConfig
from .download_manager import DownloadManager, DownloadMode
from .streaming_download_manager import StreamingDownloadManager


