






"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__A		:       Dict  				=		{
    '''configuration_lxmert''': ['''LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''LxmertConfig'''],
    '''tokenization_lxmert''': ['''LxmertTokenizer'''],
}

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:       int  				=		['''LxmertTokenizerFast''']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:       Any  				=		[
						    '''LxmertEncoder''',
						    '''LxmertForPreTraining''',
						    '''LxmertForQuestionAnswering''',
						    '''LxmertModel''',
						    '''LxmertPreTrainedModel''',
						    '''LxmertVisualFeatureEncoder''',
						    '''LxmertXLayer''',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:       Any  				=		[
						    '''TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''TFLxmertForPreTraining''',
						    '''TFLxmertMainLayer''',
						    '''TFLxmertModel''',
						    '''TFLxmertPreTrainedModel''',
						    '''TFLxmertVisualFeatureEncoder''',
						]


if TYPE_CHECKING:
						from .configuration_lxmert import LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP, LxmertConfig
						from .tokenization_lxmert import LxmertTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_lxmert_fast import LxmertTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_lxmert import (
												    LxmertEncoder,
												    LxmertForPreTraining,
												    LxmertForQuestionAnswering,
												    LxmertModel,
												    LxmertPreTrainedModel,
												    LxmertVisualFeatureEncoder,
												    LxmertXLayer,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_lxmert import (
												    TF_LXMERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFLxmertForPreTraining,
												    TFLxmertMainLayer,
												    TFLxmertModel,
												    TFLxmertPreTrainedModel,
												    TFLxmertVisualFeatureEncoder,
												)

else:
						import sys

						__A		:       List[str]  				=		_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)











from typing import List

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


__UpperCAmelCase								=						logging.get_logger(__name__)

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



class   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Optional[int]       						=  '''efficientformer'''



		def __init__(							self				,		_UpperCamelCase = [3, 2, 6, 4]				,		_UpperCamelCase = [4_8, 9_6, 2_2_4, 4_4_8]				,		_UpperCamelCase = [True, True, True, True]				,		_UpperCamelCase = 4_4_8				,		_UpperCamelCase = 3_2				,		_UpperCamelCase = 4				,		_UpperCamelCase = 7				,		_UpperCamelCase = 5				,		_UpperCamelCase = 8				,		_UpperCamelCase = 4				,		_UpperCamelCase = 0.0				,		_UpperCamelCase = 1_6				,		_UpperCamelCase = 3				,		_UpperCamelCase = 3				,		_UpperCamelCase = 3				,		_UpperCamelCase = 2				,		_UpperCamelCase = 1				,		_UpperCamelCase = 0.0				,		_UpperCamelCase = 1				,		_UpperCamelCase = True				,		_UpperCamelCase = True				,		_UpperCamelCase = 1E-5				,		_UpperCamelCase = "gelu"				,		_UpperCamelCase = 0.02				,		_UpperCamelCase = 1E-12				,		_UpperCamelCase = 2_2_4				,		_UpperCamelCase = 1E-05				,		**_UpperCamelCase				,		)	->							None:
							super().__init__(**_UpperCamelCase   )

							UpperCAmelCase_    :      int            =						hidden_act
							UpperCAmelCase_    :      Union[str, Any]            =						hidden_dropout_prob
							UpperCAmelCase_    :      Tuple            =						hidden_sizes
							UpperCAmelCase_    :      Union[str, Any]            =						num_hidden_layers
							UpperCAmelCase_    :      List[str]            =						num_attention_heads
							UpperCAmelCase_    :      List[Any]            =						initializer_range
							UpperCAmelCase_    :      int            =						layer_norm_eps
							UpperCAmelCase_    :      List[str]            =						patch_size
							UpperCAmelCase_    :      Union[str, Any]            =						num_channels
							UpperCAmelCase_    :      Optional[Any]            =						depths
							UpperCAmelCase_    :      List[Any]            =						mlp_expansion_ratio
							UpperCAmelCase_    :      List[str]            =						downsamples
							UpperCAmelCase_    :      List[Any]            =						dim
							UpperCAmelCase_    :      Tuple            =						key_dim
							UpperCAmelCase_    :      Optional[int]            =						attention_ratio
							UpperCAmelCase_    :      str            =						resolution
							UpperCAmelCase_    :      Dict            =						pool_size
							UpperCAmelCase_    :      Union[str, Any]            =						downsample_patch_size
							UpperCAmelCase_    :      List[str]            =						downsample_stride
							UpperCAmelCase_    :      List[str]            =						downsample_pad
							UpperCAmelCase_    :      Any            =						drop_path_rate
							UpperCAmelCase_    :      Dict            =						num_metaad_blocks
							UpperCAmelCase_    :      Dict            =						distillation
							UpperCAmelCase_    :      int            =						use_layer_scale
							UpperCAmelCase_    :      Any            =						layer_scale_init_value
							UpperCAmelCase_    :      Any            =						image_size
							UpperCAmelCase_    :      Dict            =						batch_norm_eps






