






"""simple docstring"""



import pytest

import datasets


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



def 						lowercase    (				__snake_case				: List[Any]		,					__snake_case				: Dict	):
		# 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 						lowercase    (				__snake_case				: List[str]	):
		config.addinivalue_line('''markers'''		,					'''torchaudio_latest: mark test to run with torchaudio>=0.12'''	)



@pytest.fixture(autouse=__snake_case	)
def 						lowercase    (				__snake_case				: List[Any]		,					__snake_case				: Dict	):
		# test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
		lowercase_ : Optional[int]							       =   tmp_path_factory.getbasetemp() / '''cache'''
		lowercase_ : List[str]							       =   test_hf_cache_home / '''datasets'''
		lowercase_ : Any							       =   test_hf_cache_home / '''metrics'''
		lowercase_ : Optional[int]							       =   test_hf_cache_home / '''modules'''
		monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''		,					str(__snake_case	)	)
		monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''		,					str(__snake_case	)	)
		monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''		,					str(__snake_case	)	)
		lowercase_ : Optional[Any]							       =   test_hf_datasets_cache / '''downloads'''
		monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''		,					str(__snake_case	)	)
		lowercase_ : Tuple							       =   test_hf_datasets_cache / '''downloads''' / '''extracted'''
		monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''		,					str(__snake_case	)	)



@pytest.fixture(autouse=__snake_case		,					scope='''session'''	)
def 						lowercase    (				):
		datasets.disable_progress_bar()



@pytest.fixture(autouse=__snake_case	)
def 						lowercase    (				__snake_case				: List[Any]	):
		# don't take tests into account when counting downloads
		monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''		,					__snake_case	)






@pytest.fixture
def 						lowercase    (				__snake_case				: Tuple	):
		# 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'''		,					__snake_case	)











"""simple docstring"""



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


__A		:       Dict  				=		logging.get_logger(__name__)

__A		:       Union[str, Any]  				=		{
    '''facebook/vit-mae-base''': '''https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json''',
    # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae
}





class 					_UpperCAmelCase       ( _A							):
					SCREAMING_SNAKE_CASE_		:				Union[str, Any]							    =   "vit_mae"




					def __init__(				self     :						Dict    ,						A     :						List[str]=7_68    ,						A     :						Any=12    ,						A     :						Union[str, Any]=12    ,						A     :						Tuple=30_72    ,						A     :						Any="gelu"    ,						A     :						Tuple=0.0    ,						A     :						List[str]=0.0    ,						A     :						Tuple=0.02    ,						A     :						Tuple=1e-12    ,						A     :						int=2_24    ,						A     :						Dict=16    ,						A     :						int=3    ,						A     :						Tuple=True    ,						A     :						Tuple=16    ,						A     :						Optional[Any]=5_12    ,						A     :						Union[str, Any]=8    ,						A     :						List[Any]=20_48    ,						A     :						Dict=0.75    ,						A     :						Any=False    ,						**A     :						Optional[int]    ,						)  ->  Union[str, Any]:
							super().__init__(**A   )

							lowercase_ : List[Any]							       =   hidden_size
							lowercase_ : str							       =   num_hidden_layers
							lowercase_ : List[Any]							       =   num_attention_heads
							lowercase_ : Any							       =   intermediate_size
							lowercase_ : Optional[int]							       =   hidden_act
							lowercase_ : List[Any]							       =   hidden_dropout_prob
							lowercase_ : int							       =   attention_probs_dropout_prob
							lowercase_ : int							       =   initializer_range
							lowercase_ : Dict							       =   layer_norm_eps
							lowercase_ : Optional[Any]							       =   image_size
							lowercase_ : str							       =   patch_size
							lowercase_ : Dict							       =   num_channels
							lowercase_ : Any							       =   qkv_bias
							lowercase_ : Union[str, Any]							       =   decoder_num_attention_heads
							lowercase_ : Optional[Any]							       =   decoder_hidden_size
							lowercase_ : List[str]							       =   decoder_num_hidden_layers
							lowercase_ : List[Any]							       =   decoder_intermediate_size
							lowercase_ : Optional[Any]							       =   mask_ratio
							lowercase_ : Optional[Any]							       =   norm_pix_loss



