





'''simple docstring'''



import copy

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


_SCREAMING_SNAKE_CASE   =      logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE   =      {
    '''SenseTime/deformable-detr''': '''https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json''',
    # See all Deformable DETR models at https://huggingface.co/models?filter=deformable-detr
}






class 							__lowercase    ( lowerCAmelCase__  ):







	'''simple docstring'''

	a      :			Tuple     =    "deformable_detr"
	a      :			int     =    {
	    "hidden_size": "d_model",
	    "num_attention_heads": "encoder_attention_heads",
	}


	def __init__(self       ,_lowerCamelCase=True       ,_lowerCamelCase=None       ,_lowerCamelCase=3       ,_lowerCamelCase=300       ,_lowerCamelCase=1024       ,_lowerCamelCase=6       ,_lowerCamelCase=1024       ,_lowerCamelCase=8       ,_lowerCamelCase=6       ,_lowerCamelCase=1024       ,_lowerCamelCase=8       ,_lowerCamelCase=0.0       ,_lowerCamelCase=True       ,_lowerCamelCase="relu"       ,_lowerCamelCase=256       ,_lowerCamelCase=0.1       ,_lowerCamelCase=0.0       ,_lowerCamelCase=0.0       ,_lowerCamelCase=0.0_2       ,_lowerCamelCase=1.0       ,_lowerCamelCase=True       ,_lowerCamelCase=False       ,_lowerCamelCase="sine"       ,_lowerCamelCase="resnet50"       ,_lowerCamelCase=True       ,_lowerCamelCase=False       ,_lowerCamelCase=4       ,_lowerCamelCase=4       ,_lowerCamelCase=4       ,_lowerCamelCase=False       ,_lowerCamelCase=300       ,_lowerCamelCase=False       ,_lowerCamelCase=1       ,_lowerCamelCase=5       ,_lowerCamelCase=2       ,_lowerCamelCase=1       ,_lowerCamelCase=1       ,_lowerCamelCase=5       ,_lowerCamelCase=2       ,_lowerCamelCase=0.1       ,_lowerCamelCase=0.2_5       ,_lowerCamelCase=False       ,**_lowerCamelCase       ,)							->							Union[str, Any]:







				'''simple docstring'''





				if backbone_config is not None and use_timm_backbone:
							raise ValueError('''You can\'t specify both `backbone_config` and `use_timm_backbone`.'''	)

				if not use_timm_backbone:
							if backbone_config is None:
										logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''	)
										__lowercase			  =							CONFIG_MAPPING['''resnet'''](out_features=['''stage4''']	)
							elif isinstance(_lowerCamelCase       ,_lowerCamelCase	):
										__lowercase			  =							backbone_config.get('''model_type'''	)
										__lowercase			  =							CONFIG_MAPPING[backbone_model_type]
										__lowercase			  =							config_class.from_dict(_lowerCamelCase	)
				__lowercase			  =							use_timm_backbone
				__lowercase			  =							backbone_config
				__lowercase			  =							num_channels
				__lowercase			  =							num_queries
				__lowercase			  =							max_position_embeddings
				__lowercase			  =							d_model
				__lowercase			  =							encoder_ffn_dim
				__lowercase			  =							encoder_layers
				__lowercase			  =							encoder_attention_heads
				__lowercase			  =							decoder_ffn_dim
				__lowercase			  =							decoder_layers
				__lowercase			  =							decoder_attention_heads
				__lowercase			  =							dropout
				__lowercase			  =							attention_dropout
				__lowercase			  =							activation_dropout
				__lowercase			  =							activation_function
				__lowercase			  =							init_std
				__lowercase			  =							init_xavier_std
				__lowercase			  =							encoder_layerdrop
				__lowercase			  =							auxiliary_loss
				__lowercase			  =							position_embedding_type
				__lowercase			  =							backbone
				__lowercase			  =							use_pretrained_backbone
				__lowercase			  =							dilation
				# deformable attributes
				__lowercase			  =							num_feature_levels
				__lowercase			  =							encoder_n_points
				__lowercase			  =							decoder_n_points
				__lowercase			  =							two_stage
				__lowercase			  =							two_stage_num_proposals
				__lowercase			  =							with_box_refine
				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
				__lowercase			  =							class_cost
				__lowercase			  =							bbox_cost
				__lowercase			  =							giou_cost
				# Loss coefficients
				__lowercase			  =							mask_loss_coefficient
				__lowercase			  =							dice_loss_coefficient
				__lowercase			  =							bbox_loss_coefficient
				__lowercase			  =							giou_loss_coefficient
				__lowercase			  =							eos_coefficient
				__lowercase			  =							focal_alpha
				__lowercase			  =							disable_custom_kernels
				super().__init__(is_encoder_decoder=_lowerCamelCase       ,**_lowerCamelCase	)


	@property
	def   _UpperCAmelCase       (self	)							->							int:







				'''simple docstring'''





				return self.encoder_attention_heads


	@property
	def   _UpperCAmelCase       (self	)							->							int:







				'''simple docstring'''





				return self.d_model


	def   _UpperCAmelCase       (self	)							->							List[str]:







				'''simple docstring'''





				__lowercase			  =							copy.deepcopy(self.__dict__	)
				if self.backbone_config is not None:
							__lowercase			  =							self.backbone_config.to_dict()
				__lowercase			  =							self.__class__.model_type
				return output












'''simple docstring'''



def 				_lowerCAmelCase  (			lowerCamelCase_     :					Union[str, Any]			):
			__lowercase			  =							1
			__lowercase			  =							2
			while i * i <= n:
						__lowercase			  =							0
						while n % i == 0:
									n //= i
									multiplicity += 1
						n_divisors *= multiplicity + 1
						i += 1
			if n > 1:
						n_divisors *= 2
			return n_divisors




def 				_lowerCAmelCase  (			):
			__lowercase			  =							1
			__lowercase			  =							1

			while True:
						i += 1
						t_num += i

						if count_divisors(lowerCamelCase_			) > 5_0_0:
									break

			return t_num


if __name__ == "__main__":
	print(solution())





