





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


UpperCAmelCase						:   Tuple			  =     logging.get_logger(__name__)

UpperCAmelCase						:   List[str]			  =     {
    '''microsoft/swinv2-tiny-patch4-window8-256''': (
        '''https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json'''
    ),
}





class 						_A(					snake_case__   ):


				"""simple docstring"""


				UpperCamelCase    :  List[str]					    =	'''swinv2'''

				UpperCamelCase    :  Any					    =	{
				    '''num_attention_heads''': '''num_heads''',
				    '''num_hidden_layers''': '''num_layers''',
				}



				def __init__(			self     ,					_A=224     ,					_A=4     ,					_A=3     ,					_A=96     ,					_A=[2, 2, 6, 2]     ,					_A=[3, 6, 12, 24]     ,					_A=7     ,					_A=4.0     ,					_A=True     ,					_A=0.0     ,					_A=0.0     ,					_A=0.1     ,					_A="gelu"     ,					_A=False     ,					_A=0.0_2     ,					_A=1e-5     ,					_A=32     ,					**_A     ,					):
									super().__init__(**_A     )

									__A	:						Dict       =				image_size
									__A	:						Dict       =				patch_size
									__A	:						List[Any]       =				num_channels
									__A	:						List[str]       =				embed_dim
									__A	:						Tuple       =				depths
									__A	:						List[Any]       =				len(_A     )
									__A	:						Union[str, Any]       =				num_heads
									__A	:						Union[str, Any]       =				window_size
									__A	:						Optional[int]       =				mlp_ratio
									__A	:						str       =				qkv_bias
									__A	:						Optional[int]       =				hidden_dropout_prob
									__A	:						Optional[Any]       =				attention_probs_dropout_prob
									__A	:						Union[str, Any]       =				drop_path_rate
									__A	:						List[str]       =				hidden_act
									__A	:						Union[str, Any]       =				use_absolute_embeddings
									__A	:						Union[str, Any]       =				layer_norm_eps
									__A	:						str       =				initializer_range
									__A	:						Tuple       =				encoder_stride
									# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
									# this indicates the channel dimension after the last stage of the model
									__A	:						Optional[int]       =				int(embed_dim * 2 ** (len(_A     ) - 1)     )
									__A	:						List[Any]       =				(0, 0, 0, 0)











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


UpperCAmelCase						:   Optional[int]			  =     {
    '''configuration_xlm''': ['''XLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''XLMConfig''', '''XLMOnnxConfig'''],
    '''tokenization_xlm''': ['''XLMTokenizer'''],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase						:   Union[str, Any]			  =     [
				    '''XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''XLMForMultipleChoice''',
				    '''XLMForQuestionAnswering''',
				    '''XLMForQuestionAnsweringSimple''',
				    '''XLMForSequenceClassification''',
				    '''XLMForTokenClassification''',
				    '''XLMModel''',
				    '''XLMPreTrainedModel''',
				    '''XLMWithLMHeadModel''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				UpperCAmelCase						:   Optional[Any]			  =     [
				    '''TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFXLMForMultipleChoice''',
				    '''TFXLMForQuestionAnsweringSimple''',
				    '''TFXLMForSequenceClassification''',
				    '''TFXLMForTokenClassification''',
				    '''TFXLMMainLayer''',
				    '''TFXLMModel''',
				    '''TFXLMPreTrainedModel''',
				    '''TFXLMWithLMHeadModel''',
				]


if TYPE_CHECKING:
				from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
				from .tokenization_xlm import XLMTokenizer

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_xlm import (
								    XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    XLMForMultipleChoice,
								    XLMForQuestionAnswering,
								    XLMForQuestionAnsweringSimple,
								    XLMForSequenceClassification,
								    XLMForTokenClassification,
								    XLMModel,
								    XLMPreTrainedModel,
								    XLMWithLMHeadModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_xlm import (
								    TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFXLMForMultipleChoice,
								    TFXLMForQuestionAnsweringSimple,
								    TFXLMForSequenceClassification,
								    TFXLMForTokenClassification,
								    TFXLMMainLayer,
								    TFXLMModel,
								    TFXLMPreTrainedModel,
								    TFXLMWithLMHeadModel,
								)

else:
				import sys

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




