


import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


snake_case							:	List[Any]					      =				{
    '''debug''': logging.DEBUG,
    '''info''': logging.INFO,
    '''warning''': logging.WARNING,
    '''error''': logging.ERROR,
    '''critical''': logging.CRITICAL,
}

snake_case							:	int					      =				logging.WARNING






def 							__lowercase       (			):
							a__					=					os.getenv('DATASETS_VERBOSITY' ,   __lowerCAmelCase       )
							if env_level_str:
														if env_level_str in log_levels:
																					return log_levels[env_level_str]
														else:
																					logging.getLogger().warning(
																					    F'Unknown option DATASETS_VERBOSITY={env_level_str}, '
																					    F'has to be one of: { ", ".join(log_levels.keys()       ) }'       )
							return _default_log_level






def 							__lowercase       (			):
							return __name__.split('.'       )[0]






def 							__lowercase       (			):
							return logging.getLogger(_get_library_name()       )






def 							__lowercase       (			):
							# Apply our default configuration to the library root logger.
							a__					=					_get_library_root_logger()
							library_root_logger.setLevel(_get_default_logging_level()       )






def 							__lowercase       (			):
							a__					=					_get_library_root_logger()
							library_root_logger.setLevel(logging.NOTSET       )






def 							__lowercase       (			__lowerCAmelCase							:    Optional[str] = None       ):
							if name is None:
														a__					=					_get_library_name()
							return logging.getLogger(__lowerCAmelCase       )






def 							__lowercase       (			):
							return _get_library_root_logger().getEffectiveLevel()






def 							__lowercase       (			__lowerCAmelCase							:    int       ):
							_get_library_root_logger().setLevel(__lowerCAmelCase       )






def 							__lowercase       (			):
							return set_verbosity(__lowerCAmelCase       )






def 							__lowercase       (			):
							return set_verbosity(__lowerCAmelCase       )






def 							__lowercase       (			):
							return set_verbosity(__lowerCAmelCase       )






def 							__lowercase       (			):
							return set_verbosity(__lowerCAmelCase       )






def 							__lowercase       (			):
							a__					=					False






def 							__lowercase       (			):
							a__					=					True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()







class 	snake_case_       :
					def __init__(				self       :Any      ,*__snake_case       :Optional[int]      ,**__snake_case       :Optional[int]				) ->   List[str]:  # pylint: disable=unused-argument
												a__					=					args[0] if args else None
					def __iter__(				self       :Tuple				) ->   List[str]:
												return iter(self._iterator				)
					def __getattr__(				self       :Any      ,__snake_case       :str				) ->   Union[str, Any]:

												def empty_fn(*__snake_case       :Union[str, Any]      ,**__snake_case       :int				):  # pylint: disable=unused-argument
																			return

												return empty_fn
					def __enter__(				self       :Any				) ->   List[Any]:
												return self



					def __exit__(				self       :Any      ,__snake_case       :List[str]      ,__snake_case       :Any      ,__snake_case       :Tuple				) ->   Any:
												return





snake_case							:	Union[str, Any]					      =				True







class 	snake_case_       :
					def __call__(				self       :Union[str, Any]      ,*__snake_case       :Optional[Any]      ,__snake_case       :List[Any]=False      ,**__snake_case       :List[Any]				) ->   Any:
												if _tqdm_active and not disable:
																			return tqdm_lib.tqdm(*__snake_case      ,**__snake_case				)
												else:
																			return EmptyTqdm(*__snake_case      ,**__snake_case				)
					def 			lowerCamelCase__(				self       :Optional[int]      ,*__snake_case       :Union[str, Any]      ,**__snake_case       :Any				) ->   Any:
												a__					=					None
												if _tqdm_active:
																			return tqdm_lib.tqdm.set_lock(*__snake_case      ,**__snake_case				)



					def 			lowerCamelCase__(				self       :Optional[int]				) ->   Tuple:
												if _tqdm_active:
																			return tqdm_lib.tqdm.get_lock()





snake_case							:	List[str]					      =				_tqdm_cls()






def 							__lowercase       (			):
							global _tqdm_active
							return bool(_tqdm_active       )






def 							__lowercase       (			):
							global _tqdm_active
							a__					=					True






def 							__lowercase       (			):
							global _tqdm_active
							a__					=					False








from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


snake_case							:	Tuple					      =				logging.get_logger(__name__)

snake_case							:	List[Any]					      =				{
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}







class 	snake_case_       (lowerCamelCase_				):
					UpperCAmelCase__ :   int   				=      '''efficientformer'''
					def __init__(				self       :List[str]      ,__snake_case       :List[int] = [3, 2, 6, 4]      ,__snake_case       :List[int] = [48, 96, 2_24, 4_48]      ,__snake_case       :List[bool] = [True, True, True, True]      ,__snake_case       :int = 4_48      ,__snake_case       :int = 32      ,__snake_case       :int = 4      ,__snake_case       :int = 7      ,__snake_case       :int = 5      ,__snake_case       :int = 8      ,__snake_case       :int = 4      ,__snake_case       :float = 0.0      ,__snake_case       :int = 16      ,__snake_case       :int = 3      ,__snake_case       :int = 3      ,__snake_case       :int = 3      ,__snake_case       :int = 2      ,__snake_case       :int = 1      ,__snake_case       :float = 0.0      ,__snake_case       :int = 1      ,__snake_case       :bool = True      ,__snake_case       :bool = True      ,__snake_case       :float = 1E-5      ,__snake_case       :str = "gelu"      ,__snake_case       :float = 0.02      ,__snake_case       :float = 1E-12      ,__snake_case       :int = 2_24      ,__snake_case       :float = 1E-05      ,**__snake_case       :Dict      ,) ->   None:
												super().__init__(**__snake_case				)

												a__					=					hidden_act
												a__					=					hidden_dropout_prob
												a__					=					hidden_sizes
												a__					=					num_hidden_layers
												a__					=					num_attention_heads
												a__					=					initializer_range
												a__					=					layer_norm_eps
												a__					=					patch_size
												a__					=					num_channels
												a__					=					depths
												a__					=					mlp_expansion_ratio
												a__					=					downsamples
												a__					=					dim
												a__					=					key_dim
												a__					=					attention_ratio
												a__					=					resolution
												a__					=					pool_size
												a__					=					downsample_patch_size
												a__					=					downsample_stride
												a__					=					downsample_pad
												a__					=					drop_path_rate
												a__					=					num_metaad_blocks
												a__					=					distillation
												a__					=					use_layer_scale
												a__					=					layer_scale_init_value
												a__					=					image_size
												a__					=					batch_norm_eps




