'''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_	   = logging.get_logger(__name__)

A_	   = {
    "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json",
    "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json",
    "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json",
    "apple/deeplabv3-mobilevit-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json"
    ),
    "apple/deeplabv3-mobilevit-x-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json"
    ),
    "apple/deeplabv3-mobilevit-xx-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json"
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}




class 		SCREAMING_SNAKE_CASE_					(_UpperCAmelCase      ):



			"""simple docstring"""






			__magic_name__ :				Dict   							=       """mobilevit"""



			def __init__(							self				,			snake_case_=3				,			snake_case_=256				,			snake_case_=2				,			snake_case_=[144, 192, 240]				,			snake_case_=[16, 32, 64, 96, 128, 160, 640]				,			snake_case_=4				,			snake_case_=2.0				,			snake_case_=4.0				,			snake_case_="silu"				,			snake_case_=3				,			snake_case_=32				,			snake_case_=0.1				,			snake_case_=0.0				,			snake_case_=0.1				,			snake_case_=0.02				,			snake_case_=1e-5				,			snake_case_=True				,			snake_case_=256				,			snake_case_=[6, 12, 18]				,			snake_case_=0.1				,			snake_case_=255				,			**snake_case_				,			):
									super().__init__(**snake_case_					)

									snake_case :       List[str]				=    num_channels
									snake_case :       str				=    image_size
									snake_case :       str				=    patch_size
									snake_case :       str				=    hidden_sizes
									snake_case :       Optional[int]				=    neck_hidden_sizes
									snake_case :       Optional[int]				=    num_attention_heads
									snake_case :       Tuple				=    mlp_ratio
									snake_case :       Dict				=    expand_ratio
									snake_case :       int				=    hidden_act
									snake_case :       List[str]				=    conv_kernel_size
									snake_case :       Union[str, Any]				=    output_stride
									snake_case :       Optional[Any]				=    hidden_dropout_prob
									snake_case :       int				=    attention_probs_dropout_prob
									snake_case :       List[Any]				=    classifier_dropout_prob
									snake_case :       Optional[Any]				=    initializer_range
									snake_case :       Optional[int]				=    layer_norm_eps
									snake_case :       Tuple				=    qkv_bias

									# decode head attributes for semantic segmentation
									snake_case :       Union[str, Any]				=    aspp_out_channels
									snake_case :       List[str]				=    atrous_rates
									snake_case :       int				=    aspp_dropout_prob
									snake_case :       Optional[int]				=    semantic_loss_ignore_index







class 		SCREAMING_SNAKE_CASE_					(_UpperCAmelCase      ):



			"""simple docstring"""






			__magic_name__ :				Optional[Any]   							=       version.parse("""1.11"""      )



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



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






			@property
			def   lowerCamelCase (							self					):
									return 1e-4






'''simple docstring'''

# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

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


A_	   = {
    "configuration_convnextv2": [
        "CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ConvNextV2Config",
    ]
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_	   = [
						    "CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "ConvNextV2ForImageClassification",
						    "ConvNextV2Model",
						    "ConvNextV2PreTrainedModel",
						    "ConvNextV2Backbone",
						]


if TYPE_CHECKING:
						from .configuration_convnextva import (
						    CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    ConvNextVaConfig,
						)

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_convnextva import (
												    CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ConvNextVaBackbone,
												    ConvNextVaForImageClassification,
												    ConvNextVaModel,
												    ConvNextVaPreTrainedModel,
												)

else:
						import sys

						A_	   = _LazyModule(__name__, globals()["__file__"], _import_structure)





