



"""simple docstring"""






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


__snake_case							:     Optional[Any]   =					logging.get_logger(__name__)

__snake_case							:     List[Any]   =					{
    '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     A__     (						__SCREAMING_SNAKE_CASE							):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE					   =			'segformer'

	def __init__(  self:	Dict ,    _SCREAMING_SNAKE_CASE:	Optional[Any]=3 ,    _SCREAMING_SNAKE_CASE:	Dict=4 ,    _SCREAMING_SNAKE_CASE:	List[Any]=[2, 2, 2, 2] ,    _SCREAMING_SNAKE_CASE:	str=[8, 4, 2, 1] ,    _SCREAMING_SNAKE_CASE:	Any=[32, 64, 160, 256] ,    _SCREAMING_SNAKE_CASE:	Tuple=[7, 3, 3, 3] ,    _SCREAMING_SNAKE_CASE:	List[str]=[4, 2, 2, 2] ,    _SCREAMING_SNAKE_CASE:	Tuple=[1, 2, 5, 8] ,    _SCREAMING_SNAKE_CASE:	Optional[int]=[4, 4, 4, 4] ,    _SCREAMING_SNAKE_CASE:	List[str]="gelu" ,    _SCREAMING_SNAKE_CASE:	Any=0.0 ,    _SCREAMING_SNAKE_CASE:	Union[str, Any]=0.0 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=0.1 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=0.02 ,    _SCREAMING_SNAKE_CASE:	str=0.1 ,    _SCREAMING_SNAKE_CASE:	Optional[int]=1e-6 ,    _SCREAMING_SNAKE_CASE:	int=256 ,    _SCREAMING_SNAKE_CASE:	Tuple=255 ,    **_SCREAMING_SNAKE_CASE:	int ,    )       -> Optional[Any]:

				"""simple docstring"""

				super().__init__(**_SCREAMING_SNAKE_CASE)

				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." ,    _SCREAMING_SNAKE_CASE ,    )

				__lowerCAmelCase   :						str				= num_channels
				__lowerCAmelCase   :						Any				= num_encoder_blocks
				__lowerCAmelCase   :						str				= depths
				__lowerCAmelCase   :						Tuple				= sr_ratios
				__lowerCAmelCase   :						Optional[int]				= hidden_sizes
				__lowerCAmelCase   :						Optional[int]				= patch_sizes
				__lowerCAmelCase   :						Optional[Any]				= strides
				__lowerCAmelCase   :						Optional[int]				= mlp_ratios
				__lowerCAmelCase   :						Union[str, Any]				= num_attention_heads
				__lowerCAmelCase   :						Optional[Any]				= hidden_act
				__lowerCAmelCase   :						Dict				= hidden_dropout_prob
				__lowerCAmelCase   :						List[str]				= attention_probs_dropout_prob
				__lowerCAmelCase   :						Union[str, Any]				= classifier_dropout_prob
				__lowerCAmelCase   :						Union[str, Any]				= initializer_range
				__lowerCAmelCase   :						Union[str, Any]				= drop_path_rate
				__lowerCAmelCase   :						Union[str, Any]				= layer_norm_eps
				__lowerCAmelCase   :						List[Any]				= decoder_hidden_size
				__lowerCAmelCase   :						Any				= kwargs.get("reshape_last_stage" ,    _SCREAMING_SNAKE_CASE)
				__lowerCAmelCase   :						int				= semantic_loss_ignore_index






class     A__     (						__SCREAMING_SNAKE_CASE							):




	'''simple docstring'''





	SCREAMING_SNAKE_CASE					   =			version.parse('1.11'							)

	@property
	def 							_SCREAMING_SNAKE_CASE     (  self:	Tuple)       -> Mapping[str, Mapping[int, str]]:

				"""simple docstring"""

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

	@property
	def 							_SCREAMING_SNAKE_CASE     (  self:	List[str])       -> float:

				"""simple docstring"""

				return 1e-4







	@property
	def 							_SCREAMING_SNAKE_CASE     (  self:	str)       -> int:

				"""simple docstring"""

				return 12




"""simple docstring"""






from abc import ABC, abstractmethod
from argparse import ArgumentParser



class     A__     (						__SCREAMING_SNAKE_CASE							):




	'''simple docstring'''





	@staticmethod
	@abstractmethod
	def 							_SCREAMING_SNAKE_CASE     (  _SCREAMING_SNAKE_CASE:	ArgumentParser)       -> str:

				"""simple docstring"""

				raise NotImplementedError()







	@abstractmethod
	def 							_SCREAMING_SNAKE_CASE     (  self:	List[str])       -> str:

				"""simple docstring"""

				raise NotImplementedError()