





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						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			"segformer"

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



   '''simple docstring'''



   super().__init__(**UpperCAmelCase_)

   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."       , UpperCAmelCase_       , )

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



class    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			version.parse("1.11"    )

 @property
 def 							SCREAMING_SNAKE_CASE_					(self				:   int)       ->Mapping[str, Mapping[int, str]]:



   '''simple docstring'''



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

 @property
 def 							SCREAMING_SNAKE_CASE_					(self				:   Optional[int])       ->float:



   '''simple docstring'''



   return 1E-4







 @property
 def 							SCREAMING_SNAKE_CASE_					(self				:   Union[str, Any])       ->int:



   '''simple docstring'''



   return 12








import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
__A									=				"."


if __name__ == "__main__":
     __A									=				os.path.join(REPO_PATH, "utils/documentation_tests.txt")
     __A									=				[]
     __A									=				[]
     with open(doctest_file_path) as fp:
          for line in fp:
               __A									=				line.strip()
               __A									=				os.path.join(REPO_PATH, line)
               if not (os.path.isfile(path) or os.path.isdir(path)):
                    non_existent_paths.append(line)
               all_paths.append(path)
     if len(non_existent_paths) > 0:
          __A									=				"\n".join(non_existent_paths)
          raise ValueError(f'`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}')
     if all_paths != sorted(all_paths):
          raise ValueError("Files in `utils/documentation_tests.txt` are not in alphabetical order.")

