

"""simple docstring"""




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


__A  :					Dict												=	logging.get_logger(__name__)

__A  :					Union[str, Any]												=	{
    'apple/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}





class     __UpperCamelCase				(     _A		):
		SCREAMING_SNAKE_CASE              =					"mobilevitv2"


		def __init__(self				:	Optional[Any]  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=3  ,  __SCREAMING_SNAKE_CASE				:	Any=2_5_6  ,  __SCREAMING_SNAKE_CASE				:	str=2  ,  __SCREAMING_SNAKE_CASE				:	Any=2.0  ,  __SCREAMING_SNAKE_CASE				:	List[Any]="swish"  ,  __SCREAMING_SNAKE_CASE				:	Tuple=3  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=3_2  ,  __SCREAMING_SNAKE_CASE				:	Tuple=0.1  ,  __SCREAMING_SNAKE_CASE				:	Union[str, Any]=0.0_2  ,  __SCREAMING_SNAKE_CASE				:	Union[str, Any]=1E-5  ,  __SCREAMING_SNAKE_CASE				:	List[Any]=5_1_2  ,  __SCREAMING_SNAKE_CASE				:	List[Any]=[6, 1_2, 1_8]  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=0.1  ,  __SCREAMING_SNAKE_CASE				:	Optional[int]=2_5_5  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=[2, 4, 3]  ,  __SCREAMING_SNAKE_CASE				:	Dict=[1_2_8, 1_9_2, 2_5_6]  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=1.0  ,  __SCREAMING_SNAKE_CASE				:	int=2  ,  __SCREAMING_SNAKE_CASE				:	Optional[Any]=0.0  ,  __SCREAMING_SNAKE_CASE				:	int=0.0  ,  **__SCREAMING_SNAKE_CASE				:	Optional[Any]  ,  ):
							super().__init__(**__SCREAMING_SNAKE_CASE)

							A    =      num_channels
							A    =      image_size
							A    =      patch_size
							A    =      expand_ratio
							A    =      hidden_act
							A    =      conv_kernel_size
							A    =      output_stride
							A    =      initializer_range
							A    =      layer_norm_eps
							A    =      n_attn_blocks
							A    =      base_attn_unit_dims
							A    =      width_multiplier
							A    =      ffn_multiplier
							A    =      ffn_dropout
							A    =      attn_dropout
							A    =      classifier_dropout_prob

							# decode head attributes for semantic segmentation
							A    =      aspp_out_channels
							A    =      atrous_rates
							A    =      aspp_dropout_prob
							A    =      semantic_loss_ignore_index





class     __UpperCamelCase				(     _A		):
		SCREAMING_SNAKE_CASE              =					version.parse("1.11"		)


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


		@property
		def       SCREAMING_SNAKE_CASE__     (self				:	Optional[int]):
							if self.task == "image-classification":
												return OrderedDict([("logits", {0: "batch"})])
							else:
												return OrderedDict([("last_hidden_state", {0: "batch"}), ("pooler_output", {0: "batch"})])


		@property
		def       SCREAMING_SNAKE_CASE__     (self				:	str):
							return 1E-4








"""simple docstring"""




from typing import TYPE_CHECKING

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


__A  :					int												=	{
    'configuration_nystromformer': ['NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'NystromformerConfig'],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__A  :					Any												=	[
	    'NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'NystromformerForMaskedLM',
	    'NystromformerForMultipleChoice',
	    'NystromformerForQuestionAnswering',
	    'NystromformerForSequenceClassification',
	    'NystromformerForTokenClassification',
	    'NystromformerLayer',
	    'NystromformerModel',
	    'NystromformerPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_nystromformer import NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, NystromformerConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_nystromformer import (
		    NYSTROMFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    NystromformerForMaskedLM,
		    NystromformerForMultipleChoice,
		    NystromformerForQuestionAnswering,
		    NystromformerForSequenceClassification,
		    NystromformerForTokenClassification,
		    NystromformerLayer,
		    NystromformerModel,
		    NystromformerPreTrainedModel,
		)


else:
	import sys

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





