import warnings
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						:   Any         =			logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE						:   Tuple         =			{
    'nvidia/segformer-b0-finetuned-ade-512-512': (
        'https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json'
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}



class        lowercase_   (					__snake_case		):
       _lowerCamelCase						=		'segformer'



       def __init__(						self				,    lowercase_=3				,    lowercase_=4				,    lowercase_=[2, 2, 2, 2]				,    lowercase_=[8, 4, 2, 1]				,    lowercase_=[32, 64, 160, 256]				,    lowercase_=[7, 3, 3, 3]				,    lowercase_=[4, 2, 2, 2]				,    lowercase_=[1, 2, 5, 8]				,    lowercase_=[4, 4, 4, 4]				,    lowercase_="gelu"				,    lowercase_=0.0				,    lowercase_=0.0				,    lowercase_=0.1				,    lowercase_=0.02				,    lowercase_=0.1				,    lowercase_=1e-6				,    lowercase_=256				,    lowercase_=255				,    **lowercase_				,    ):
             super().__init__(**lowercase_    )

             if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
                   warnings.warn(
                       "Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be"
                       " removed, as the behaviour will default to that of reshape_last_stage = True."				,    lowercase_				,    )

             _snake_case						:					str    =   num_channels
             _snake_case						:					List[Any]    =   num_encoder_blocks
             _snake_case						:					Any    =   depths
             _snake_case						:					Optional[Any]    =   sr_ratios
             _snake_case						:					str    =   hidden_sizes
             _snake_case						:					int    =   patch_sizes
             _snake_case						:					Any    =   strides
             _snake_case						:					str    =   mlp_ratios
             _snake_case						:					Union[str, Any]    =   num_attention_heads
             _snake_case						:					Optional[int]    =   hidden_act
             _snake_case						:					Optional[int]    =   hidden_dropout_prob
             _snake_case						:					Tuple    =   attention_probs_dropout_prob
             _snake_case						:					List[str]    =   classifier_dropout_prob
             _snake_case						:					Optional[Any]    =   initializer_range
             _snake_case						:					Any    =   drop_path_rate
             _snake_case						:					Union[str, Any]    =   layer_norm_eps
             _snake_case						:					int    =   decoder_hidden_size
             _snake_case						:					Union[str, Any]    =   kwargs.get("reshape_last_stage"				,    lowercase_    )
             _snake_case						:					Optional[Any]    =   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



       @property
       def 	UpperCamelCase	(						self    ):
             return 12
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__)