

'''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__						,			)  -> Tuple:





           '''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    )  -> Dict:





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



'''simple docstring'''







from __future__ import annotations

from typing import Any
def  UpperCAmelCase__      ( UpperCAmelCase__			)     ->     int:
       if not postfix_notation:
              return 0

       A_		   = {"""+""", """-""", """*""", """/"""}
       A_		   = []

       for token in postfix_notation:
              if token in operations:
                     A_   ,     A_		   = stack.pop(), stack.pop()
                     if token == "+":
                            stack.append(a + b			)
                     elif token == "-":
                            stack.append(a - b			)
                     elif token == "*":
                            stack.append(a * b			)
                     else:
                            if a * b < 0 and a % b != 0:
                                   stack.append(a // b + 1			)
                            else:
                                   stack.append(a // b			)
              else:
                     stack.append(int(UpperCAmelCase__			)			)

       return stack.pop()


if __name__ == "__main__":
      import doctest

      doctest.testmod()
