




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


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    lowercase(	__a					):







 '''simple docstring'''





 lowercase__					   =   "segformer"


 def __init__(							self:						List[str], a_:						Any=3, a_:						List[Any]=4, a_:						int=[2, 2, 2, 2], a_:						Any=[8, 4, 2, 1], a_:						List[str]=[32, 64, 160, 256], a_:						str=[7, 3, 3, 3], a_:						int=[4, 2, 2, 2], a_:						int=[1, 2, 5, 8], a_:						Dict=[4, 4, 4, 4], a_:						Optional[int]="gelu", a_:						Union[str, Any]=0.0, a_:						int=0.0, a_:						List[Any]=0.1, a_:						Dict=0.02, a_:						Union[str, Any]=0.1, a_:						Optional[Any]=1E-6, a_:						List[Any]=256, a_:						Optional[int]=255, **a_:						str, ):




   '''simple docstring'''



   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_, )

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







class    lowercase(	__a					):







 '''simple docstring'''





 lowercase__					   =   version.parse("1.11"					)


 @property
 def 					UpperCamelCase_  (							self:						Union[str, Any]						):




   '''simple docstring'''



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


 @property
 def 					UpperCamelCase_  (							self:						str						):




   '''simple docstring'''



   return 1E-4


 @property
 def 					UpperCamelCase_  (							self:						Optional[Any]						):




   '''simple docstring'''



   return 12



from typing import Optional
from urllib.parse import quote

import huggingface_hub as hfh
from packaging import version


def 				lowerCAmelCase__       (			a__    ,     a__    ,     a__ = None )      ->str:




  '''simple docstring'''

  if version.parse(hfh.__version__ ).release < version.parse("0.11.0" ).release:
    # old versions of hfh don't url-encode the file path
    _UpperCamelCase           =    quote(a__ )
  return hfh.hf_hub_url(a__    ,     a__    ,     repo_type="dataset"    ,     revision=a__ )




