



"""simple docstring"""

import copy

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


a_       =       logging.get_logger(__name__)







class  __lowercase  (       UpperCamelCase__):







						"""simple docstring"""







						_A		:				str											=		"""upernet"""







						def __init__(self ,		lowercase__=None ,		lowercase__=5_12 ,		lowercase__=0.02 ,		lowercase__=[1, 2, 3, 6] ,		lowercase__=True ,		lowercase__=0.4 ,		lowercase__=3_84 ,		lowercase__=2_56 ,		lowercase__=1 ,		lowercase__=False ,		lowercase__=2_55 ,		**lowercase__ ,		):
											super().__init__(**__snake_case							)

											if backbone_config is None:
																logger.info("""`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."""							)
																snake_case_       :		Optional[Any]			       =       CONFIG_MAPPING["""resnet"""](out_features=["""stage1""", """stage2""", """stage3""", """stage4"""]							)
											elif isinstance(__snake_case ,		__snake_case							):
																snake_case_       :		int			       =       backbone_config.get("""model_type"""							)
																snake_case_       :		Optional[Any]			       =       CONFIG_MAPPING[backbone_model_type]
																snake_case_       :		List[Any]			       =       config_class.from_dict(__snake_case							)

											snake_case_       :		Dict			       =       backbone_config
											snake_case_       :		Optional[Any]			       =       hidden_size
											snake_case_       :		List[str]			       =       initializer_range
											snake_case_       :		Tuple			       =       pool_scales
											snake_case_       :		Optional[Any]			       =       use_auxiliary_head
											snake_case_       :		List[str]			       =       auxiliary_loss_weight
											snake_case_       :		int			       =       auxiliary_in_channels
											snake_case_       :		Optional[int]			       =       auxiliary_channels
											snake_case_       :		Optional[int]			       =       auxiliary_num_convs
											snake_case_       :		int			       =       auxiliary_concat_input
											snake_case_       :		Optional[Any]			       =       loss_ignore_index







						def     __UpperCamelCase				(self							):
											snake_case_       :		List[str]			       =       copy.deepcopy(self.__dict__							)
											snake_case_       :		Dict			       =       self.backbone_config.to_dict()
											snake_case_       :		Optional[int]			       =       self.__class__.model_type
											return output










import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script




@require_cpu
class 		__A   (      unittest.TestCase      ):

						def      A__    (		self :Tuple			):
										'''simple docstring'''

										debug_launcher(test_script.main			)


						def      A__    (		self :Dict			):
										'''simple docstring'''

										debug_launcher(test_ops.main			)




