
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


__magic_name__           =					logging.get_logger(__name__)

__magic_name__           =					{
    '''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	):
      _A  :						Union[str, Any]      		=       'mobilevit'
      def __init__(     self						,		lowerCamelCase=3						,		lowerCamelCase=2_56						,		lowerCamelCase=2						,		lowerCamelCase=[1_44, 1_92, 2_40]						,		lowerCamelCase=[16, 32, 64, 96, 1_28, 1_60, 6_40]						,		lowerCamelCase=4						,		lowerCamelCase=2.0						,		lowerCamelCase=4.0						,		lowerCamelCase="silu"						,		lowerCamelCase=3						,		lowerCamelCase=32						,		lowerCamelCase=0.1						,		lowerCamelCase=0.0						,		lowerCamelCase=0.1						,		lowerCamelCase=0.0_2						,		lowerCamelCase=1e-5						,		lowerCamelCase=True						,		lowerCamelCase=2_56						,		lowerCamelCase=[6, 12, 18]						,		lowerCamelCase=0.1						,		lowerCamelCase=2_55						,		**lowerCamelCase						,		):
          super().__init__(**lowerCamelCase	)

          snake_case__  =			num_channels
          snake_case__  =			image_size
          snake_case__  =			patch_size
          snake_case__  =			hidden_sizes
          snake_case__  =			neck_hidden_sizes
          snake_case__  =			num_attention_heads
          snake_case__  =			mlp_ratio
          snake_case__  =			expand_ratio
          snake_case__  =			hidden_act
          snake_case__  =			conv_kernel_size
          snake_case__  =			output_stride
          snake_case__  =			hidden_dropout_prob
          snake_case__  =			attention_probs_dropout_prob
          snake_case__  =			classifier_dropout_prob
          snake_case__  =			initializer_range
          snake_case__  =			layer_norm_eps
          snake_case__  =			qkv_bias

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





class    _SCREAMING_SNAKE_CASE					( __UpperCamelCase	):
      _A  :						Tuple      		=       version.parse('1.11'	)
      @property
      def A_     (     self	):
          return OrderedDict([("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"})]	)
      @property
      def A_     (     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 A_     (     self	):
          return 1e-4





# 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,
)


__magic_name__           =					{
    '''configuration_convnextv2''': [
        '''CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ConvNextV2Config''',
    ]
}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__           =					[
         '''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

     __magic_name__           =					_LazyModule(__name__, globals()['''__file__'''], _import_structure)



