






import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


A__			:    Optional[int]         =				logging.get_logger(__name__)
class    _UpperCAmelCase      ( A__			):

				"""simple docstring"""




				lowercase__       							= """upernet"""




				def __init__(  self		:					Optional[int],						lowerCamelCase		:					Any=None,						lowerCamelCase		:					int=512,						lowerCamelCase		:					Optional[Any]=0.02,						lowerCamelCase		:					Optional[int]=[1, 2, 3, 6],						lowerCamelCase		:					str=True,						lowerCamelCase		:					Tuple=0.4,						lowerCamelCase		:					Dict=384,						lowerCamelCase		:					Union[str, Any]=256,						lowerCamelCase		:					int=1,						lowerCamelCase		:					List[Any]=False,						lowerCamelCase		:					List[Any]=255,						**lowerCamelCase		:					Any,						):

								'''simple docstring'''
								super().__init__(**lowerCamelCase						)

								if backbone_config is None:
												logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''						)
												lowercase__     				=    CONFIG_MAPPING['''resnet'''](out_features=['''stage1''', '''stage2''', '''stage3''', '''stage4''']						)
								elif isinstance(lowerCamelCase,						lowerCamelCase						):
												lowercase__     				=    backbone_config.get('''model_type'''						)
												lowercase__     				=    CONFIG_MAPPING[backbone_model_type]
												lowercase__     				=    config_class.from_dict(lowerCamelCase						)

								lowercase__     				=    backbone_config
								lowercase__     				=    hidden_size
								lowercase__     				=    initializer_range
								lowercase__     				=    pool_scales
								lowercase__     				=    use_auxiliary_head
								lowercase__     				=    auxiliary_loss_weight
								lowercase__     				=    auxiliary_in_channels
								lowercase__     				=    auxiliary_channels
								lowercase__     				=    auxiliary_num_convs
								lowercase__     				=    auxiliary_concat_input
								lowercase__     				=    loss_ignore_index




				def        lowercase__     (  self		:					Optional[Any]						):

								'''simple docstring'''
								lowercase__     				=    copy.deepcopy(self.__dict__						)
								lowercase__     				=    self.backbone_config.to_dict()
								lowercase__     				=    self.__class__.model_type
								return output












from transformers import DistilBertTokenizer, DistilBertTokenizerFast
from transformers.testing_utils import require_tokenizers, slow

from ..bert.test_tokenization_bert import BertTokenizationTest
@require_tokenizers
class    _UpperCAmelCase      ( A__			):

				"""simple docstring"""




				lowercase__       							= DistilBertTokenizer
				lowercase__       							= DistilBertTokenizerFast
				lowercase__       							= True




				@slow
				def        lowercase__     (  self		:					str						):

								'''simple docstring'''
								lowercase__     				=    DistilBertTokenizer.from_pretrained('''distilbert-base-uncased'''						)

								lowercase__     				=    tokenizer.encode('''sequence builders''',						add_special_tokens=lowerCamelCase						)
								lowercase__     				=    tokenizer.encode('''multi-sequence build''',						add_special_tokens=lowerCamelCase						)

								lowercase__     				=    tokenizer.build_inputs_with_special_tokens(lowerCamelCase						)
								lowercase__     				=    tokenizer.build_inputs_with_special_tokens(lowerCamelCase,						lowerCamelCase						)

								assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]
								assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [
								    tokenizer.sep_token_id
								]




