
'''simple docstring'''






A			      =      {
    'Pillow': 'Pillow',
    'accelerate': 'accelerate>=0.11.0',
    'compel': 'compel==0.1.8',
    'black': 'black~=23.1',
    'datasets': 'datasets',
    'filelock': 'filelock',
    'flax': 'flax>=0.4.1',
    'hf-doc-builder': 'hf-doc-builder>=0.3.0',
    'huggingface-hub': 'huggingface-hub>=0.13.2',
    'requests-mock': 'requests-mock==1.10.0',
    'importlib_metadata': 'importlib_metadata',
    'invisible-watermark': 'invisible-watermark',
    'isort': 'isort>=5.5.4',
    'jax': 'jax>=0.2.8,!=0.3.2',
    'jaxlib': 'jaxlib>=0.1.65',
    'Jinja2': 'Jinja2',
    'k-diffusion': 'k-diffusion>=0.0.12',
    'torchsde': 'torchsde',
    'note_seq': 'note_seq',
    'librosa': 'librosa',
    'numpy': 'numpy',
    'omegaconf': 'omegaconf',
    'parameterized': 'parameterized',
    'protobuf': 'protobuf>=3.20.3,<4',
    'pytest': 'pytest',
    'pytest-timeout': 'pytest-timeout',
    'pytest-xdist': 'pytest-xdist',
    'ruff': 'ruff>=0.0.241',
    'safetensors': 'safetensors',
    'sentencepiece': 'sentencepiece>=0.1.91,!=0.1.92',
    'scipy': 'scipy',
    'onnx': 'onnx',
    'regex': 'regex!=2019.12.17',
    'requests': 'requests',
    'tensorboard': 'tensorboard',
    'torch': 'torch>=1.4',
    'torchvision': 'torchvision',
    'transformers': 'transformers>=4.25.1',
    'urllib3': 'urllib3<=2.0.0',
}


'''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


A			      =      logging.get_logger(__name__)

A			      =      {
    '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     __snake_case		(   a__):
					_lowerCAmelCase			     =	'''segformer'''
					def __init__(     self,    A=3,    A=4,    A=[2, 2, 2, 2],    A=[8, 4, 2, 1],    A=[32, 64, 160, 256],    A=[7, 3, 3, 3],    A=[4, 2, 2, 2],    A=[1, 2, 5, 8],    A=[4, 4, 4, 4],    A="gelu",    A=0.0,    A=0.0,    A=0.1,    A=0.02,    A=0.1,    A=1e-6,    A=256,    A=255,    **A,    ):

									"""simple docstring"""


									super().__init__(**A      )

									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.',    A,    )

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





class     __snake_case		(   a__):
					_lowerCAmelCase			     =	version.parse('''1.11''')
					@property
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


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

									"""simple docstring"""


									return 1e-4




					@property
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									return 12
