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


__magic_name__       =			logging.get_logger(__name__)

__magic_name__       =			{
    "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 						SCREAMING_SNAKE_CASE_ (						__a ):




		"""simple docstring"""





		__lowercase							:  List[Any]						   =		'''segformer'''




		def __init__(     self							,  lowerCAmelCase__=3							,  lowerCAmelCase__=4							,  lowerCAmelCase__=[2, 2, 2, 2]							,  lowerCAmelCase__=[8, 4, 2, 1]							,  lowerCAmelCase__=[3_2, 6_4, 1_6_0, 2_5_6]							,  lowerCAmelCase__=[7, 3, 3, 3]							,  lowerCAmelCase__=[4, 2, 2, 2]							,  lowerCAmelCase__=[1, 2, 5, 8]							,  lowerCAmelCase__=[4, 4, 4, 4]							,  lowerCAmelCase__="gelu"							,  lowerCAmelCase__=0.0							,  lowerCAmelCase__=0.0							,  lowerCAmelCase__=0.1							,  lowerCAmelCase__=0.02							,  lowerCAmelCase__=0.1							,  lowerCAmelCase__=1E-6							,  lowerCAmelCase__=2_5_6							,  lowerCAmelCase__=2_5_5							,  **lowerCAmelCase__							,  ):
				super().__init__(**lowerCAmelCase__)

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

				__SCREAMING_SNAKE_CASE            = num_channels
				__SCREAMING_SNAKE_CASE            = num_encoder_blocks
				__SCREAMING_SNAKE_CASE            = depths
				__SCREAMING_SNAKE_CASE            = sr_ratios
				__SCREAMING_SNAKE_CASE            = hidden_sizes
				__SCREAMING_SNAKE_CASE            = patch_sizes
				__SCREAMING_SNAKE_CASE            = strides
				__SCREAMING_SNAKE_CASE            = mlp_ratios
				__SCREAMING_SNAKE_CASE            = num_attention_heads
				__SCREAMING_SNAKE_CASE            = hidden_act
				__SCREAMING_SNAKE_CASE            = hidden_dropout_prob
				__SCREAMING_SNAKE_CASE            = attention_probs_dropout_prob
				__SCREAMING_SNAKE_CASE            = classifier_dropout_prob
				__SCREAMING_SNAKE_CASE            = initializer_range
				__SCREAMING_SNAKE_CASE            = drop_path_rate
				__SCREAMING_SNAKE_CASE            = layer_norm_eps
				__SCREAMING_SNAKE_CASE            = decoder_hidden_size
				__SCREAMING_SNAKE_CASE            = kwargs.get("""reshape_last_stage"""							,  lowerCAmelCase__)
				__SCREAMING_SNAKE_CASE            = semantic_loss_ignore_index



class 						SCREAMING_SNAKE_CASE_ (						__a ):




		"""simple docstring"""





		__lowercase							:  Optional[int]						   =		version.parse('''1.11''' )




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




		@property
		def 	snake_case_     (     self):
				return 1E-4




		@property
		def 	snake_case_     (     self):
				return 1_2






"""simple docstring"""





from ..utils import DummyObject, requires_backends
class 						SCREAMING_SNAKE_CASE_ (						metaclass=__a ):




		"""simple docstring"""





		__lowercase							:  Tuple						   =		['''keras_nlp''']




		def __init__(     self							,  *lowerCAmelCase__							,  **lowerCAmelCase__):
				requires_backends(self							,  ["""keras_nlp"""])




