






'''simple docstring'''







import unittest

import numpy as np

from transformers import is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
       import tensorflow as tf

       from transformers.activations_tf import get_tf_activation






@require_tf
class 					a__    (			unittest.TestCase						):
     '''simple docstring'''







     def     _UpperCamelCase   (self    :	List[str]					)  ->       Union[str, Any]:
           __A		   =      tf.constant([-100, -1.0, -0.1, 0, 0.1, 1.0, 1_00.0]					)
           __A		   =      get_tf_activation("gelu"					)
           __A		   =      get_tf_activation("gelu_10"					)

           __A		   =      gelu(lowercase__					)
           __A		   =      geluaa(lowercase__					)

           __A		   =      tf.where(y_gelu_aa < 10.0				,				1.0				,				0.0					)

           self.assertEqual(tf.math.reduce_max(lowercase__					).numpy().item()				,				10.0					)
           self.assertTrue(np.allclose(y_gelu * clipped_mask				,				y_gelu_aa * clipped_mask					)					)






     def     _UpperCamelCase   (self    :	Optional[int]					)  ->       int:
           get_tf_activation("gelu"					)
           get_tf_activation("gelu_10"					)
           get_tf_activation("gelu_fast"					)
           get_tf_activation("gelu_new"					)
           get_tf_activation("glu"					)
           get_tf_activation("mish"					)
           get_tf_activation("quick_gelu"					)
           get_tf_activation("relu"					)
           get_tf_activation("sigmoid"					)
           get_tf_activation("silu"					)
           get_tf_activation("swish"					)
           get_tf_activation("tanh"					)
           with self.assertRaises(lowercase__					):
                 get_tf_activation("bogus"					)
           with self.assertRaises(lowercase__					):
                 get_tf_activation(lowercase__					)










'''simple docstring'''







from typing import List

import datasets
from datasets.tasks import ImageClassification

from ..folder_based_builder import folder_based_builder


__A      :       Tuple      =	datasets.utils.logging.get_logger(__name__)






class 					a__    (			folder_based_builder.FolderBasedBuilderConfig						):
     '''simple docstring'''







     _snake_case             =  None
     _snake_case             =  None







class 					a__    (			folder_based_builder.FolderBasedBuilder						):
     '''simple docstring'''







     _snake_case             =  datasets.Image()
     _snake_case             =  'image'
     _snake_case             =  ImageFolderConfig
     _snake_case             =  42  # definition at the bottom of the script
     _snake_case             =  ImageClassification(image_column='image' ,						label_column='label'						)







__A      :       Any      =	[
    '.blp',
    '.bmp',
    '.dib',
    '.bufr',
    '.cur',
    '.pcx',
    '.dcx',
    '.dds',
    '.ps',
    '.eps',
    '.fit',
    '.fits',
    '.fli',
    '.flc',
    '.ftc',
    '.ftu',
    '.gbr',
    '.gif',
    '.grib',
    '.h5',
    '.hdf',
    '.png',
    '.apng',
    '.jp2',
    '.j2k',
    '.jpc',
    '.jpf',
    '.jpx',
    '.j2c',
    '.icns',
    '.ico',
    '.im',
    '.iim',
    '.tif',
    '.tiff',
    '.jfif',
    '.jpe',
    '.jpg',
    '.jpeg',
    '.mpg',
    '.mpeg',
    '.msp',
    '.pcd',
    '.pxr',
    '.pbm',
    '.pgm',
    '.ppm',
    '.pnm',
    '.psd',
    '.bw',
    '.rgb',
    '.rgba',
    '.sgi',
    '.ras',
    '.tga',
    '.icb',
    '.vda',
    '.vst',
    '.webp',
    '.wmf',
    '.emf',
    '.xbm',
    '.xpm',
]
__A      :       List[Any]      =	IMAGE_EXTENSIONS


