'''simple docstring'''




import copy

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


__UpperCAmelCase					=logging.get_logger(__name__)




class        a__ (  UpperCAmelCase__					):
     lowerCamelCase    :	Any				="upernet"






     def __init__(					self						:						Any    ,							a						:						Tuple=None    ,							a						:						Any=5_12    ,							a						:						Optional[Any]=0.02    ,							a						:						Union[str, Any]=[1, 2, 3, 6]    ,							a						:						Dict=True    ,							a						:						List[Any]=0.4    ,							a						:						Tuple=3_84    ,							a						:						int=2_56    ,							a						:						Dict=1    ,							a						:						Dict=False    ,							a						:						Any=2_55    ,							**a						:						Union[str, Any]    ,							):





         """simple docstring"""



         super().__init__(**a       )

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

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






     def   SCREAMING_SNAKE_CASE__  (					self						:						Optional[int]       ):





         """simple docstring"""



         __lowerCamelCase            =    copy.deepcopy(self.__dict__       )
         __lowerCamelCase            =    self.backbone_config.to_dict()
         __lowerCamelCase            =    self.__class__.model_type
         return output

'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							)      ->       bool:
    if not isinstance(UpperCamelCase__							,    UpperCamelCase__							):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''							)
    if len(UpperCamelCase__							) == 0:
        raise ValueError('''Input list must be a non empty list'''							)
    if len(UpperCamelCase__							) == 1:
        return True
    __lowerCamelCase            =    series[1] - series[0]
    for index in range(len(UpperCamelCase__							) - 1							):
        if series[index + 1] - series[index] != common_diff:
            return False
    return True






def __lowerCAmelCase					(				UpperCamelCase__							)      ->       float:
    if not isinstance(UpperCamelCase__							,    UpperCamelCase__							):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''							)
    if len(UpperCamelCase__							) == 0:
        raise ValueError('''Input list must be a non empty list'''							)
    __lowerCamelCase            =    0
    for val in series:
        answer += val
    return answer / len(UpperCamelCase__							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
