from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__SCREAMING_SNAKE_CASE						:   List[Any]         =			logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE						:   Dict         =			{
    'microsoft/beit-base-patch16-224-pt22k': (
        'https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json'
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}



class        lowercase_   (					__snake_case		):
							_lowerCamelCase						=		'beit'



							def __init__(						self				,    lowercase_=8_192				,    lowercase_=768				,    lowercase_=12				,    lowercase_=12				,    lowercase_=3_072				,    lowercase_="gelu"				,    lowercase_=0.0				,    lowercase_=0.0				,    lowercase_=0.02				,    lowercase_=1e-12				,    lowercase_=224				,    lowercase_=16				,    lowercase_=3				,    lowercase_=False				,    lowercase_=False				,    lowercase_=False				,    lowercase_=False				,    lowercase_=0.1				,    lowercase_=0.1				,    lowercase_=True				,    lowercase_=[3, 5, 7, 11]				,    lowercase_=[1, 2, 3, 6]				,    lowercase_=True				,    lowercase_=0.4				,    lowercase_=256				,    lowercase_=1				,    lowercase_=False				,    lowercase_=255				,    **lowercase_				,    ):
													super().__init__(**lowercase_    )

													_snake_case						:					Union[str, Any]    =   vocab_size
													_snake_case						:					int    =   hidden_size
													_snake_case						:					List[str]    =   num_hidden_layers
													_snake_case						:					str    =   num_attention_heads
													_snake_case						:					List[str]    =   intermediate_size
													_snake_case						:					List[Any]    =   hidden_act
													_snake_case						:					Optional[Any]    =   hidden_dropout_prob
													_snake_case						:					Optional[Any]    =   attention_probs_dropout_prob
													_snake_case						:					int    =   initializer_range
													_snake_case						:					List[str]    =   layer_norm_eps

													_snake_case						:					Dict    =   image_size
													_snake_case						:					Any    =   patch_size
													_snake_case						:					Optional[int]    =   num_channels
													_snake_case						:					Optional[Any]    =   use_mask_token
													_snake_case						:					Tuple    =   use_absolute_position_embeddings
													_snake_case						:					Optional[int]    =   use_relative_position_bias
													_snake_case						:					Optional[int]    =   use_shared_relative_position_bias
													_snake_case						:					List[str]    =   layer_scale_init_value
													_snake_case						:					Union[str, Any]    =   drop_path_rate
													_snake_case						:					int    =   use_mean_pooling
													# decode head attributes (semantic segmentation)
													_snake_case						:					List[str]    =   out_indices
													_snake_case						:					int    =   pool_scales
													# auxiliary head attributes (semantic segmentation)
													_snake_case						:					List[str]    =   use_auxiliary_head
													_snake_case						:					Any    =   auxiliary_loss_weight
													_snake_case						:					Optional[Any]    =   auxiliary_channels
													_snake_case						:					Any    =   auxiliary_num_convs
													_snake_case						:					Dict    =   auxiliary_concat_input
													_snake_case						:					Dict    =   semantic_loss_ignore_index




class        lowercase_   (					__snake_case		):
							_lowerCamelCase						=		version.parse('1.11'		)



							@property
							def 	UpperCamelCase	(						self    ):
													return OrderedDict(
													    [
													        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
													    ]    )



							@property
							def 	UpperCamelCase	(						self    ):
													return 1e-4
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__SCREAMING_SNAKE_CASE						:   Optional[Any]         =			{
    'configuration_autoformer': [
        'AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'AutoformerConfig',
    ],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__SCREAMING_SNAKE_CASE						:   Union[str, Any]         =			[
				    'AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'AutoformerForPrediction',
				    'AutoformerModel',
				    'AutoformerPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_autoformer import (
				    AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    AutoformerConfig,
				)

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_autoformer import (
								    AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
								    AutoformerForPrediction,
								    AutoformerModel,
								    AutoformerPreTrainedModel,
								)

else:
				import sys

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