



from typing import List

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


SCREAMING_SNAKE_CASE__       =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       =      {
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}


class      __lowerCAmelCase     (		UpperCAmelCase_      ):
					"""simple docstring"""






					A__				:		str			       =    "efficientformer"



					def __init__(     self					:       List[Any]				,					_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					:       Optional[Any]				,					):






								"""simple docstring"""


								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









import pytest

import datasets


# Import fixture modules as plugins
SCREAMING_SNAKE_CASE__       =      ['''tests.fixtures.files''', '''tests.fixtures.hub''', '''tests.fixtures.fsspec''']


def A						(       __UpperCamelCase ,	__UpperCamelCase					)						->      Optional[int]:
			# Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
			for item in items:
						if any(marker in item.keywords for marker in ['integration', 'unit']					):
									continue
						item.add_marker(pytest.mark.unit					)


def A						(       __UpperCamelCase					)						->      str:
			config.addinivalue_line('markers' ,	'torchaudio_latest: mark test to run with torchaudio>=0.12'					)


@pytest.fixture(autouse=__UpperCamelCase					)
def A						(       __UpperCamelCase ,	__UpperCamelCase					)						->      Union[str, Any]:
			# test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
			A__       =    tmp_path_factory.getbasetemp() / 'cache'
			A__       =    test_hf_cache_home / 'datasets'
			A__       =    test_hf_cache_home / 'metrics'
			A__       =    test_hf_cache_home / 'modules'
			monkeypatch.setattr('datasets.config.HF_DATASETS_CACHE' ,	str(__UpperCamelCase					)					)
			monkeypatch.setattr('datasets.config.HF_METRICS_CACHE' ,	str(__UpperCamelCase					)					)
			monkeypatch.setattr('datasets.config.HF_MODULES_CACHE' ,	str(__UpperCamelCase					)					)
			A__       =    test_hf_datasets_cache / 'downloads'
			monkeypatch.setattr('datasets.config.DOWNLOADED_DATASETS_PATH' ,	str(__UpperCamelCase					)					)
			A__       =    test_hf_datasets_cache / 'downloads' / 'extracted'
			monkeypatch.setattr('datasets.config.EXTRACTED_DATASETS_PATH' ,	str(__UpperCamelCase					)					)


@pytest.fixture(autouse=__UpperCamelCase ,	scope='session'					)
def A						(       )						->      Union[str, Any]:
			datasets.disable_progress_bar()


@pytest.fixture(autouse=__UpperCamelCase					)
def A						(       __UpperCamelCase					)						->      int:
			# don't take tests into account when counting downloads
			monkeypatch.setattr('datasets.config.HF_UPDATE_DOWNLOAD_COUNTS' ,	__UpperCamelCase					)






@pytest.fixture
def A						(       __UpperCamelCase					)						->      Any:
			# Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
			# To be removed once SQLAlchemy 2.0 supported
			monkeypatch.setattr('sqlalchemy.util.deprecations.SILENCE_UBER_WARNING' ,	__UpperCamelCase					)




