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










from ...configuration_utils import PretrainedConfig
from ...utils import logging


_snake_case										=       logging.get_logger(__name__)

_snake_case										=       {
    "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json",
    "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json"
    # See all FNet models at https://huggingface.co/models?filter=fnet
}







class 						lowercase							(   UpperCamelCase__		):
     _a							 =						"fnet"

     def __init__(  self		,     _a=3_2000		,     _a=768		,     _a=12		,     _a=3072		,     _a="gelu_new"		,     _a=0.1		,     _a=512		,     _a=4		,     _a=0.02		,     _a=1e-12		,     _a=False		,     _a=512		,     _a=3		,     _a=1		,     _a=2		,     **_a		,     )						->							int:
           super().__init__(pad_token_id=_a		,     bos_token_id=_a		,     eos_token_id=_a		,     **_a				)

           _A							:     Any			=						vocab_size
           _A							:     str			=						max_position_embeddings
           _A							:     Optional[Any]			=						hidden_size
           _A							:     List[str]			=						num_hidden_layers
           _A							:     List[str]			=						intermediate_size
           _A							:     List[Any]			=						hidden_act
           _A							:     List[str]			=						hidden_dropout_prob
           _A							:     List[str]			=						initializer_range
           _A							:     List[Any]			=						type_vocab_size
           _A							:     List[Any]			=						layer_norm_eps
           _A							:     List[str]			=						use_tpu_fourier_optimizations
           _A							:     str			=						tpu_short_seq_length

