
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        _SCREAMING_SNAKE_CASE	( 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.0_2		,    lowercase=0.1		,    lowercase=1e-6		,    lowercase=256		,    lowercase=255		,    **lowercase		,    )							->			str:
					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		,    )

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




class        _SCREAMING_SNAKE_CASE	( snake_case_		):
	lowerCAmelCase__   =					version.parse('1.11'		)



	@property
	def        SCREAMING_SNAKE_CASE_(       self					)							->			Mapping[str, Mapping[int, str]]:
					return OrderedDict(
					    [
					        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
					    ]					)



	@property
	def        SCREAMING_SNAKE_CASE_(       self					)							->			float:
					return 1e-4



	@property
	def        SCREAMING_SNAKE_CASE_(       self					)							->			int:
					return 12




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


__A							={
    '''configuration_gpt_neo''': ['''GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoConfig''', '''GPTNeoOnnxConfig'''],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A							=[
			    '''GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''GPTNeoForCausalLM''',
			    '''GPTNeoForQuestionAnswering''',
			    '''GPTNeoForSequenceClassification''',
			    '''GPTNeoForTokenClassification''',
			    '''GPTNeoModel''',
			    '''GPTNeoPreTrainedModel''',
			    '''load_tf_weights_in_gpt_neo''',
			]

try:
			if not is_flax_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			__A							=[
			    '''FlaxGPTNeoForCausalLM''',
			    '''FlaxGPTNeoModel''',
			    '''FlaxGPTNeoPreTrainedModel''',
			]


if TYPE_CHECKING:
			from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_gpt_neo import (
						    GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST,
						    GPTNeoForCausalLM,
						    GPTNeoForQuestionAnswering,
						    GPTNeoForSequenceClassification,
						    GPTNeoForTokenClassification,
						    GPTNeoModel,
						    GPTNeoPreTrainedModel,
						    load_tf_weights_in_gpt_neo,
						)

			try:
						if not is_flax_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_flax_gpt_neo import FlaxGPTNeoForCausalLM, FlaxGPTNeoModel, FlaxGPTNeoPreTrainedModel


else:
			import sys

			__A							=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


