


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


_lowerCAmelCase:						Optional[int]   				=       logging.get_logger(__name__)

_lowerCAmelCase:						Any   				=       {
    '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       lowercase_					(lowercase__   ):
				snake_case	    ='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.02       ,  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_       ,  )

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







class       lowercase_					(lowercase__   ):
				snake_case	    =version.parse('1.11'   )





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





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





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





"""simple docstring"""




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


__magic_name__						: str    =				logging.get_logger(__name__)

__magic_name__						: List[Any]    =				{
    'uclanlp/visualbert-vqa': 'https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json',
    'uclanlp/visualbert-vqa-pre': 'https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json',
    'uclanlp/visualbert-vqa-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json'
    ),
    'uclanlp/visualbert-vcr': 'https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json',
    'uclanlp/visualbert-vcr-pre': 'https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json',
    'uclanlp/visualbert-vcr-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json'
    ),
    'uclanlp/visualbert-nlvr2': 'https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json',
    'uclanlp/visualbert-nlvr2-pre': 'https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json',
    'uclanlp/visualbert-nlvr2-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json'
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}




class 			__snake_case   (lowerCamelCase  ):
							__a					 =       '''visual_bert'''




							def __init__(     self:    Any     ,							A_:    List[str]=3_05_22     ,							A_:    Tuple=7_68     ,							A_:    Dict=5_12     ,							A_:    List[Any]=12     ,							A_:    str=12     ,							A_:    Dict=30_72     ,							A_:    str="gelu"     ,							A_:    Union[str, Any]=0.1     ,							A_:    Any=0.1     ,							A_:    List[Any]=5_12     ,							A_:    int=2     ,							A_:    int=0.02     ,							A_:    Any=1E-12     ,							A_:    List[str]=False     ,							A_:    str=True     ,							A_:    Union[str, Any]=1     ,							A_:    Optional[int]=0     ,							A_:    Dict=2     ,							**A_:    Optional[int]     ,							):
										super().__init__(pad_token_id=A_     ,							bos_token_id=A_     ,							eos_token_id=A_     ,							**A_   )

										__lowerCamelCase          =      vocab_size
										__lowerCamelCase          =      max_position_embeddings
										__lowerCamelCase          =      hidden_size
										__lowerCamelCase          =      visual_embedding_dim
										__lowerCamelCase          =      num_hidden_layers
										__lowerCamelCase          =      num_attention_heads
										__lowerCamelCase          =      intermediate_size
										__lowerCamelCase          =      hidden_act
										__lowerCamelCase          =      hidden_dropout_prob
										__lowerCamelCase          =      attention_probs_dropout_prob
										__lowerCamelCase          =      initializer_range
										__lowerCamelCase          =      type_vocab_size
										__lowerCamelCase          =      layer_norm_eps
										__lowerCamelCase          =      bypass_transformer
										__lowerCamelCase          =      special_visual_initialize




