
'''simple docstring'''
import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


__lowerCAmelCase					=			[
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE=None				,   _SCREAMING_SNAKE_CASE=None				,   _SCREAMING_SNAKE_CASE=None ):
							_snake_case  =    True
							while ask_again:
														_snake_case  =    input(_snake_case )
														try:
																					if default is not None and len(_snake_case ) == 0:
																												return default
																					return convert_value(_snake_case ) if convert_value is not None else result
														except Exception:
																					if error_message is not None:
																												print(_snake_case )






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE				,   _SCREAMING_SNAKE_CASE=[]				,   _SCREAMING_SNAKE_CASE=None				,   _SCREAMING_SNAKE_CASE=0 ):
							_snake_case  =    BulletMenu(_snake_case				,   _snake_case )
							_snake_case  =    menu.run(default_choice=_snake_case )
							return convert_value(_snake_case ) if convert_value is not None else result






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    int(_snake_case )
							return ComputeEnvironment(["""LOCAL_MACHINE""", """AMAZON_SAGEMAKER"""][value] )






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    int(_snake_case )
							return DistributedType(["""NO""", """MULTI_CPU""", """MULTI_XPU""", """MULTI_GPU""", """MULTI_NPU""", """TPU"""][value] )






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    int(_snake_case )
							return DynamoBackend(DYNAMO_BACKENDS[value] ).value






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    int(_snake_case )
							return PrecisionType(["""no""", """fp16""", """bf16""", """fp8"""][value] )






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							_snake_case  =    int(_snake_case )
							return SageMakerDistributedType(["""NO""", """DATA_PARALLEL""", """MODEL_PARALLEL"""][value] )






def    __SCREAMING_SNAKE_CASE (    _SCREAMING_SNAKE_CASE ):
							return {"yes": True, "no": False}[value.lower()]


class      _lowerCAmelCase       (       argparse.RawDescriptionHelpFormatter ):







							'''simple docstring'''

							def 			lowercase				(self    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    )	->  int:
														_snake_case  =    super()._format_usage(_UpperCAmelCase    ,    _UpperCAmelCase    ,    _UpperCAmelCase    ,    _UpperCAmelCase    )
														_snake_case  =    usage.replace("""<command> [<args>] """    ,    """"""    )
														return usage





"""simple docstring"""

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


a							      =     logging.get_logger(__name__)

a							      =     {
    '''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 							lowercase_			(	__lowerCAmelCase				):



 '''simple docstring'''
 UpperCAmelCase       :	int     =      '''vit_mae'''

 def __init__(					self			:			Union[str, Any]       ,				_UpperCAmelCase			:			Optional[int]=768       ,				_UpperCAmelCase			:			Tuple=12       ,				_UpperCAmelCase			:			Optional[Any]=12       ,				_UpperCAmelCase			:			Optional[int]=3_072       ,				_UpperCAmelCase			:			Any="gelu"       ,				_UpperCAmelCase			:			Optional[Any]=0.0       ,				_UpperCAmelCase			:			Optional[int]=0.0       ,				_UpperCAmelCase			:			Dict=0.02       ,				_UpperCAmelCase			:			List[Any]=1E-1_2       ,				_UpperCAmelCase			:			Optional[Any]=224       ,				_UpperCAmelCase			:			int=16       ,				_UpperCAmelCase			:			str=3       ,				_UpperCAmelCase			:			Tuple=True       ,				_UpperCAmelCase			:			int=16       ,				_UpperCAmelCase			:			str=512       ,				_UpperCAmelCase			:			int=8       ,				_UpperCAmelCase			:			List[Any]=2_048       ,				_UpperCAmelCase			:			Optional[Any]=0.75       ,				_UpperCAmelCase			:			List[str]=False       ,				**_UpperCAmelCase			:			Union[str, Any]       ,				):
       super().__init__(**_UpperCAmelCase						)

       _A     =  hidden_size
       _A     =  num_hidden_layers
       _A     =  num_attention_heads
       _A     =  intermediate_size
       _A     =  hidden_act
       _A     =  hidden_dropout_prob
       _A     =  attention_probs_dropout_prob
       _A     =  initializer_range
       _A     =  layer_norm_eps
       _A     =  image_size
       _A     =  patch_size
       _A     =  num_channels
       _A     =  qkv_bias
       _A     =  decoder_num_attention_heads
       _A     =  decoder_hidden_size
       _A     =  decoder_num_hidden_layers
       _A     =  decoder_intermediate_size
       _A     =  mask_ratio
       _A     =  norm_pix_loss

