



'''simple docstring'''

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..bit import BitConfig


snake_case_			=     logging.get_logger(__name__)

snake_case_			=     {
    """Intel/dpt-large""": """https://huggingface.co/Intel/dpt-large/resolve/main/config.json""",
    # See all DPT models at https://huggingface.co/models?filter=dpt
}


class 	a__     (				_lowercase	):
	__magic_name__		:    Any	    =     '''dpt'''


	def __init__(self : Union[str, Any],					__UpperCAmelCase : Union[str, Any]=768,					__UpperCAmelCase : Tuple=12,					__UpperCAmelCase : Tuple=12,					__UpperCAmelCase : str=3072,					__UpperCAmelCase : Optional[int]="gelu",					__UpperCAmelCase : List[Any]=0.0,					__UpperCAmelCase : Dict=0.0,					__UpperCAmelCase : Dict=0.02,					__UpperCAmelCase : Any=1e-12,					__UpperCAmelCase : Optional[int]=384,					__UpperCAmelCase : Optional[Any]=16,					__UpperCAmelCase : Dict=3,					__UpperCAmelCase : Optional[Any]=False,					__UpperCAmelCase : Dict=True,					__UpperCAmelCase : Any=[2, 5, 8, 11],					__UpperCAmelCase : Optional[Any]="project",					__UpperCAmelCase : Tuple=[4, 2, 1, 0.5],					__UpperCAmelCase : List[Any]=[96, 192, 384, 768],					__UpperCAmelCase : Optional[Any]=256,					__UpperCAmelCase : Any=-1,					__UpperCAmelCase : Optional[int]=False,					__UpperCAmelCase : Optional[Any]=True,					__UpperCAmelCase : Dict=0.4,					__UpperCAmelCase : Dict=255,					__UpperCAmelCase : List[str]=0.1,					__UpperCAmelCase : Optional[Any]=[1, 1024, 24, 24],					__UpperCAmelCase : str=[0, 1],					__UpperCAmelCase : List[str]=None,					**__UpperCAmelCase : Dict,					)     ->			Tuple:

					"""simple docstring"""

					super().__init__(**A_      )

					SCREAMING_SNAKE_CASE  :						List[Any]      					= hidden_size
					SCREAMING_SNAKE_CASE  :						Any      					= is_hybrid

					if self.is_hybrid:
									if backbone_config is None:
													logger.info('''Initializing the config with a `BiT` backbone.'''      )
													SCREAMING_SNAKE_CASE  :						List[str]      					= {
													    '''global_padding''': '''same''',
													    '''layer_type''': '''bottleneck''',
													    '''depths''': [3, 4, 9],
													    '''out_features''': ['''stage1''', '''stage2''', '''stage3'''],
													    '''embedding_dynamic_padding''': True,
													}
													SCREAMING_SNAKE_CASE  :						List[str]      					= BitConfig(**A_      )
									elif isinstance(A_,					A_      ):
													logger.info('''Initializing the config with a `BiT` backbone.'''      )
													SCREAMING_SNAKE_CASE  :						str      					= BitConfig(**A_      )
									elif isinstance(A_,					A_      ):
													SCREAMING_SNAKE_CASE  :						int      					= backbone_config
									else:
													raise ValueError(
													    F'''backbone_config must be a dictionary or a `PretrainedConfig`, got {backbone_config.__class__}.'''      )

									SCREAMING_SNAKE_CASE  :						Any      					= backbone_featmap_shape
									SCREAMING_SNAKE_CASE  :						str      					= neck_ignore_stages

									if readout_type != "project":
													raise ValueError('''Readout type must be \'project\' when using `DPT-hybrid` mode.'''      )
					else:
									SCREAMING_SNAKE_CASE  :						int      					= None
									SCREAMING_SNAKE_CASE  :						Optional[Any]      					= None
									SCREAMING_SNAKE_CASE  :						List[str]      					= []

					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= num_hidden_layers
					SCREAMING_SNAKE_CASE  :						Tuple      					= num_attention_heads
					SCREAMING_SNAKE_CASE  :						Dict      					= intermediate_size
					SCREAMING_SNAKE_CASE  :						str      					= hidden_act
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= hidden_dropout_prob
					SCREAMING_SNAKE_CASE  :						Tuple      					= attention_probs_dropout_prob
					SCREAMING_SNAKE_CASE  :						List[str]      					= initializer_range
					SCREAMING_SNAKE_CASE  :						List[str]      					= layer_norm_eps
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= image_size
					SCREAMING_SNAKE_CASE  :						Any      					= patch_size
					SCREAMING_SNAKE_CASE  :						Any      					= num_channels
					SCREAMING_SNAKE_CASE  :						Dict      					= qkv_bias
					SCREAMING_SNAKE_CASE  :						Tuple      					= backbone_out_indices
					if readout_type not in ["ignore", "add", "project"]:
									raise ValueError('''Readout_type must be one of [\'ignore\', \'add\', \'project\']'''      )
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= readout_type
					SCREAMING_SNAKE_CASE  :						Tuple      					= reassemble_factors
					SCREAMING_SNAKE_CASE  :						Optional[int]      					= neck_hidden_sizes
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= fusion_hidden_size
					SCREAMING_SNAKE_CASE  :						int      					= head_in_index
					SCREAMING_SNAKE_CASE  :						str      					= use_batch_norm_in_fusion_residual
					# auxiliary head attributes (semantic segmentation)
					SCREAMING_SNAKE_CASE  :						Any      					= use_auxiliary_head
					SCREAMING_SNAKE_CASE  :						Dict      					= auxiliary_loss_weight
					SCREAMING_SNAKE_CASE  :						str      					= semantic_loss_ignore_index
					SCREAMING_SNAKE_CASE  :						List[Any]      					= semantic_classifier_dropout






	def 				lowercase__  (self : Optional[int]      )     ->			Dict:

					"""simple docstring"""

					SCREAMING_SNAKE_CASE  :						int      					= copy.deepcopy(self.__dict__      )

					if output["backbone_config"] is not None:
									SCREAMING_SNAKE_CASE  :						List[str]      					= self.backbone_config.to_dict()

					SCREAMING_SNAKE_CASE  :						List[str]      					= self.__class__.model_type
					return output









'''simple docstring'''

from ..utils import DummyObject, requires_backends


class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[Any]	    =     ["sentencepiece"]


	def __init__(self : Optional[Any],					*__UpperCAmelCase : List[Any],					**__UpperCAmelCase : List[Any]      )     ->			Optional[int]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Tuple	    =     ["sentencepiece"]


	def __init__(self : Optional[int],					*__UpperCAmelCase : int,					**__UpperCAmelCase : List[str]      )     ->			int:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : List[str],					*__UpperCAmelCase : str,					**__UpperCAmelCase : List[Any]      )     ->			str:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : Optional[int],					*__UpperCAmelCase : str,					**__UpperCAmelCase : Optional[Any]      )     ->			List[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[str]	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : Union[str, Any],					**__UpperCAmelCase : Tuple      )     ->			Any:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Union[str, Any]	    =     ["sentencepiece"]


	def __init__(self : List[Any],					*__UpperCAmelCase : List[Any],					**__UpperCAmelCase : Optional[Any]      )     ->			str:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    int	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : int,					**__UpperCAmelCase : Any      )     ->			Union[str, Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    str	    =     ["sentencepiece"]


	def __init__(self : int,					*__UpperCAmelCase : Optional[Any],					**__UpperCAmelCase : Tuple      )     ->			Optional[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    str	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : Optional[Any],					**__UpperCAmelCase : Tuple      )     ->			Dict:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[Any]	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : Optional[int],					**__UpperCAmelCase : Tuple      )     ->			int:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Tuple	    =     ["sentencepiece"]


	def __init__(self : List[Any],					*__UpperCAmelCase : Optional[int],					**__UpperCAmelCase : Optional[int]      )     ->			Union[str, Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    int	    =     ["sentencepiece"]


	def __init__(self : str,					*__UpperCAmelCase : str,					**__UpperCAmelCase : str      )     ->			Optional[int]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[str]	    =     ["sentencepiece"]


	def __init__(self : int,					*__UpperCAmelCase : List[str],					**__UpperCAmelCase : str      )     ->			Union[str, Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    str	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : Tuple,					**__UpperCAmelCase : str      )     ->			List[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Any	    =     ["sentencepiece"]


	def __init__(self : Dict,					*__UpperCAmelCase : Optional[int],					**__UpperCAmelCase : List[str]      )     ->			Optional[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : str,					*__UpperCAmelCase : Optional[int],					**__UpperCAmelCase : Tuple      )     ->			Dict:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[Any]	    =     ["sentencepiece"]


	def __init__(self : Union[str, Any],					*__UpperCAmelCase : int,					**__UpperCAmelCase : str      )     ->			Optional[int]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : Any,					*__UpperCAmelCase : str,					**__UpperCAmelCase : List[Any]      )     ->			Optional[int]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : List[Any],					*__UpperCAmelCase : Union[str, Any],					**__UpperCAmelCase : List[Any]      )     ->			List[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : Dict,					*__UpperCAmelCase : Optional[Any],					**__UpperCAmelCase : str      )     ->			List[Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[Any]	    =     ["sentencepiece"]


	def __init__(self : List[Any],					*__UpperCAmelCase : Any,					**__UpperCAmelCase : str      )     ->			int:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    str	    =     ["sentencepiece"]


	def __init__(self : Optional[int],					*__UpperCAmelCase : str,					**__UpperCAmelCase : Tuple      )     ->			Any:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[int]	    =     ["sentencepiece"]


	def __init__(self : Union[str, Any],					*__UpperCAmelCase : Dict,					**__UpperCAmelCase : Optional[int]      )     ->			Tuple:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Tuple	    =     ["sentencepiece"]


	def __init__(self : List[str],					*__UpperCAmelCase : Union[str, Any],					**__UpperCAmelCase : Dict      )     ->			List[str]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Any	    =     ["sentencepiece"]


	def __init__(self : int,					*__UpperCAmelCase : Union[str, Any],					**__UpperCAmelCase : Optional[Any]      )     ->			Union[str, Any]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[Any]	    =     ["sentencepiece"]


	def __init__(self : Union[str, Any],					*__UpperCAmelCase : Tuple,					**__UpperCAmelCase : List[str]      )     ->			Optional[int]:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Any	    =     ["sentencepiece"]


	def __init__(self : Optional[int],					*__UpperCAmelCase : str,					**__UpperCAmelCase : str      )     ->			str:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    int	    =     ["sentencepiece"]


	def __init__(self : Dict,					*__UpperCAmelCase : Any,					**__UpperCAmelCase : List[str]      )     ->			Dict:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    Optional[Any]	    =     ["sentencepiece"]


	def __init__(self : List[Any],					*__UpperCAmelCase : Optional[Any],					**__UpperCAmelCase : int      )     ->			Any:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    int	    =     ["sentencepiece"]


	def __init__(self : Tuple,					*__UpperCAmelCase : Optional[Any],					**__UpperCAmelCase : int      )     ->			int:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )



class 	a__     (				metaclass=_lowercase	):
	__magic_name__		:    List[Any]	    =     ["sentencepiece"]


	def __init__(self : Optional[int],					*__UpperCAmelCase : str,					**__UpperCAmelCase : List[str]      )     ->			str:

					"""simple docstring"""

					requires_backends(self,					['''sentencepiece''']      )




