






import copy

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


__a      :       str				  =   logging.get_logger(__name__)

__a      :       Optional[int]				  =   {
    "ut/deta": "https://huggingface.co/ut/deta/resolve/main/config.json",
}


class       __lowercase      (	lowercase_  ):







     '''simple docstring'''
     SCREAMING_SNAKE_CASE   						=				"deta"
     SCREAMING_SNAKE_CASE   						=				{
         "hidden_size": "d_model",
         "num_attention_heads": "encoder_attention_heads",
     }




     def __init__(				self       :			str ,	UpperCamelCase_       :			Tuple=None ,	UpperCamelCase_       :			Optional[int]=900 ,	UpperCamelCase_       :			Dict=2_048 ,	UpperCamelCase_       :			str=6 ,	UpperCamelCase_       :			Union[str, Any]=2_048 ,	UpperCamelCase_       :			Any=8 ,	UpperCamelCase_       :			Optional[Any]=6 ,	UpperCamelCase_       :			Any=1_024 ,	UpperCamelCase_       :			Union[str, Any]=8 ,	UpperCamelCase_       :			List[str]=0.0 ,	UpperCamelCase_       :			Any=True ,	UpperCamelCase_       :			Tuple="relu" ,	UpperCamelCase_       :			Tuple=256 ,	UpperCamelCase_       :			Any=0.1 ,	UpperCamelCase_       :			Union[str, Any]=0.0 ,	UpperCamelCase_       :			int=0.0 ,	UpperCamelCase_       :			Optional[int]=0.02 ,	UpperCamelCase_       :			Optional[int]=1.0 ,	UpperCamelCase_       :			Tuple=True ,	UpperCamelCase_       :			Optional[Any]=False ,	UpperCamelCase_       :			str="sine" ,	UpperCamelCase_       :			List[str]=5 ,	UpperCamelCase_       :			int=4 ,	UpperCamelCase_       :			Union[str, Any]=4 ,	UpperCamelCase_       :			Union[str, Any]=True ,	UpperCamelCase_       :			Optional[Any]=300 ,	UpperCamelCase_       :			str=True ,	UpperCamelCase_       :			Union[str, Any]=True ,	UpperCamelCase_       :			Optional[int]=1 ,	UpperCamelCase_       :			Optional[Any]=5 ,	UpperCamelCase_       :			Optional[int]=2 ,	UpperCamelCase_       :			Union[str, Any]=1 ,	UpperCamelCase_       :			Dict=1 ,	UpperCamelCase_       :			str=5 ,	UpperCamelCase_       :			Tuple=2 ,	UpperCamelCase_       :			Union[str, Any]=0.1 ,	UpperCamelCase_       :			Any=0.25 ,	**UpperCamelCase_       :			Optional[int] ,	):


         """simple docstring"""



         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=["""stage2""", """stage3""", """stage4"""]				)
         else:
             if isinstance(UpperCamelCase_ ,	UpperCamelCase_				):
                 __A         =	backbone_config.pop("""model_type"""				)
                 __A         =	CONFIG_MAPPING[backbone_model_type]
                 __A         =	config_class.from_dict(UpperCamelCase_				)

         __A         =	backbone_config
         __A         =	num_queries
         __A         =	max_position_embeddings
         __A         =	d_model
         __A         =	encoder_ffn_dim
         __A         =	encoder_layers
         __A         =	encoder_attention_heads
         __A         =	decoder_ffn_dim
         __A         =	decoder_layers
         __A         =	decoder_attention_heads
         __A         =	dropout
         __A         =	attention_dropout
         __A         =	activation_dropout
         __A         =	activation_function
         __A         =	init_std
         __A         =	init_xavier_std
         __A         =	encoder_layerdrop
         __A         =	auxiliary_loss
         __A         =	position_embedding_type
         # deformable attributes
         __A         =	num_feature_levels
         __A         =	encoder_n_points
         __A         =	decoder_n_points
         __A         =	two_stage
         __A         =	two_stage_num_proposals
         __A         =	with_box_refine
         __A         =	assign_first_stage
         if two_stage is True and with_box_refine is False:
             raise ValueError("""If two_stage is True, with_box_refine must be True."""				)
         # Hungarian matcher
         __A         =	class_cost
         __A         =	bbox_cost
         __A         =	giou_cost
         # Loss coefficients
         __A         =	mask_loss_coefficient
         __A         =	dice_loss_coefficient
         __A         =	bbox_loss_coefficient
         __A         =	giou_loss_coefficient
         __A         =	eos_coefficient
         __A         =	focal_alpha
         super().__init__(is_encoder_decoder=UpperCamelCase_ ,	**UpperCamelCase_				)




     @property
     def 		lowerCAmelCase_     (				self       :			Optional[Any]				):


         """simple docstring"""



         return self.encoder_attention_heads




     @property
     def 		lowerCAmelCase_     (				self       :			List[str]				):


         """simple docstring"""



         return self.d_model





     def 		lowerCAmelCase_     (				self       :			Optional[int]				):


         """simple docstring"""



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












from collections.abc import Sequence



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			Sequence[float]			,				__lowercase   :			float    )						->      float:





    """simple docstring"""

    return sum(c * (x**i) for i, c in enumerate(__lowercase    )    )



def 			_SCREAMING_SNAKE_CASE						( __lowercase   :			Sequence[float]			,				__lowercase   :			float    )						->      float:





    """simple docstring"""

    __A         =	0.0
    for coeff in reversed(__lowercase    ):
        __A         =	result * x + coeff
    return result


if __name__ == "__main__":
  __a      :       Dict				  =   (0.0, 0.0, 5.0, 9.3, 7.0)
  __a      :       Optional[Any]				  =   1_0.0
  print(evaluate_poly(poly, x))
  print(horner(poly, x))




