

'''simple docstring'''







import copy

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


__lowerCamelCase		       =    logging.get_logger(__name__)


class 					A__      (      _snake_case			):
    lowercase						=		"upernet"



    def __init__(					self		,				UpperCamelCase__=None		,				UpperCamelCase__=512		,				UpperCamelCase__=0.02		,				UpperCamelCase__=[1, 2, 3, 6]		,				UpperCamelCase__=True		,				UpperCamelCase__=0.4		,				UpperCamelCase__=384		,				UpperCamelCase__=256		,				UpperCamelCase__=1		,				UpperCamelCase__=False		,				UpperCamelCase__=255		,				**UpperCamelCase__		,				)						->      Union[str, Any]:





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

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

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







    def 					snake_case_			(					self       )						->      str:





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



'''simple docstring'''







def       UpperCAmelCase__    (      UpperCAmelCase__,       UpperCAmelCase__				)			->			float:
       _validate_point(UpperCAmelCase__				)
       _validate_point(UpperCAmelCase__				)
       if len(UpperCAmelCase__				) != len(UpperCAmelCase__				):
              raise ValueError("""Both points must be in the same n-dimensional space"""				)

       return float(sum(abs(a - b				) for a, b in zip(UpperCAmelCase__,       UpperCAmelCase__				)				)				)
def       UpperCAmelCase__    (      UpperCAmelCase__				)			->			None:
       if point:
              if isinstance(UpperCAmelCase__,       UpperCAmelCase__				):
                     for item in point:
                            if not isinstance(UpperCAmelCase__,       (int, float)				):
                                   A_						=      (
                                       """Expected a list of numbers as input, found """
                                       F'''{type(UpperCAmelCase__				).__name__}'''
                                   )
                                   raise TypeError(UpperCAmelCase__				)
              else:
                     A_						=      F'''Expected a list of numbers as input, found {type(UpperCAmelCase__				).__name__}'''
                     raise TypeError(UpperCAmelCase__				)
       else:
              raise ValueError("""Missing an input"""				)
def       UpperCAmelCase__    (      UpperCAmelCase__,       UpperCAmelCase__				)			->			float:
       _validate_point(UpperCAmelCase__				)
       _validate_point(UpperCAmelCase__				)
       if len(UpperCAmelCase__				) != len(UpperCAmelCase__				):
              raise ValueError("""Both points must be in the same n-dimensional space"""				)

       return float(sum(abs(x - y				) for x, y in zip(UpperCAmelCase__,       UpperCAmelCase__				)				)				)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
