

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


SCREAMING_SNAKE_CASE_        =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_        =      {
    '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  (	UpperCAmelCase				):
						_lowercase    						=			"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_						,					)

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







class 				a  (	UpperCAmelCase				):
						_lowercase    						=			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





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


SCREAMING_SNAKE_CASE_        =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_        =      {'openai-gpt': 'https://huggingface.co/openai-gpt/resolve/main/config.json'}

class 				a  (	UpperCAmelCase				):
						_lowercase    						=			"openai-gpt"
						_lowercase    						=			{
						    "max_position_embeddings": "n_positions",
						    "hidden_size": "n_embd",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}


						def __init__(       self						,					A_=40478						,					A_=512						,					A_=768						,					A_=12						,					A_=12						,					A_="gelu"						,					A_=0.1						,					A_=0.1						,					A_=0.1						,					A_=1e-5						,					A_=0.02						,					A_="cls_index"						,					A_=True						,					A_=None						,					A_=True						,					A_=0.1						,					**A_						,					):







										'''simple docstring'''


										_UpperCAmelCase       :		Any 		=    vocab_size
										_UpperCAmelCase       :		str 		=    n_positions
										_UpperCAmelCase       :		List[Any] 		=    n_embd
										_UpperCAmelCase       :		Dict 		=    n_layer
										_UpperCAmelCase       :		Any 		=    n_head
										_UpperCAmelCase       :		int 		=    afn
										_UpperCAmelCase       :		int 		=    resid_pdrop
										_UpperCAmelCase       :		Tuple 		=    embd_pdrop
										_UpperCAmelCase       :		Optional[Any] 		=    attn_pdrop
										_UpperCAmelCase       :		Any 		=    layer_norm_epsilon
										_UpperCAmelCase       :		List[str] 		=    initializer_range
										_UpperCAmelCase       :		Union[str, Any] 		=    summary_type
										_UpperCAmelCase       :		List[Any] 		=    summary_use_proj
										_UpperCAmelCase       :		Optional[Any] 		=    summary_activation
										_UpperCAmelCase       :		int 		=    summary_first_dropout
										_UpperCAmelCase       :		List[str] 		=    summary_proj_to_labels
										super().__init__(**A_	)


