





"""simple docstring"""





def       a__					(					_SCREAMING_SNAKE_CASE    ):




		"""simple docstring"""


		if not nums:  # Makes sure that the list is not empty
				raise ValueError("List is empty"    )

		UpperCamelCase   =	sum(_SCREAMING_SNAKE_CASE    ) / len(_SCREAMING_SNAKE_CASE    )  # Calculate the average
		return sum(abs(x - average    ) for x in nums    ) / len(_SCREAMING_SNAKE_CASE    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()













"""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        _lowerCamelCase      (       _lowercase ):
						UpperCAmelCase_ =			"upernet"


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

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

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




						def     snake_case_   (self		) ->   Optional[int]:
								UpperCamelCase   =	copy.deepcopy(self.__dict__		)
								UpperCamelCase   =	self.backbone_config.to_dict()
								UpperCamelCase   =	self.__class__.model_type
								return output






