
import copy

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


lowerCamelCase_						: int         =  logging.get_logger(__name__)

lowerCamelCase_						: int         =  {
    """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        _UpperCamelCase				(					_A  ):






			'''simple docstring'''

			__UpperCamelCase      :						Optional[Any]					      = """deformable_detr"""
			__UpperCamelCase      :						List[Any]					      = {
			    """hidden_size""": """d_model""",
			    """num_attention_heads""": """encoder_attention_heads""",
			}

			def __init__(       self :       int						,	snake_case_ :       int=True						,	snake_case_ :       Dict=None						,	snake_case_ :       Optional[int]=3						,	snake_case_ :       List[Any]=300						,	snake_case_ :       Tuple=1024						,	snake_case_ :       Tuple=6						,	snake_case_ :       Union[str, Any]=1024						,	snake_case_ :       List[Any]=8						,	snake_case_ :       Dict=6						,	snake_case_ :       int=1024						,	snake_case_ :       str=8						,	snake_case_ :       List[str]=0.0						,	snake_case_ :       int=True						,	snake_case_ :       Any="relu"						,	snake_case_ :       str=256						,	snake_case_ :       List[str]=0.1						,	snake_case_ :       Optional[int]=0.0						,	snake_case_ :       Optional[Any]=0.0						,	snake_case_ :       Optional[int]=0.02						,	snake_case_ :       str=1.0						,	snake_case_ :       Any=True						,	snake_case_ :       str=False						,	snake_case_ :       List[str]="sine"						,	snake_case_ :       List[Any]="resnet50"						,	snake_case_ :       int=True						,	snake_case_ :       str=False						,	snake_case_ :       Tuple=4						,	snake_case_ :       Optional[Any]=4						,	snake_case_ :       Tuple=4						,	snake_case_ :       Optional[int]=False						,	snake_case_ :       Tuple=300						,	snake_case_ :       Optional[int]=False						,	snake_case_ :       Dict=1						,	snake_case_ :       Optional[Any]=5						,	snake_case_ :       Union[str, Any]=2						,	snake_case_ :       Optional[int]=1						,	snake_case_ :       int=1						,	snake_case_ :       List[Any]=5						,	snake_case_ :       Optional[int]=2						,	snake_case_ :       Tuple=0.1						,	snake_case_ :       Any=0.25						,	snake_case_ :       Union[str, Any]=False						,	**snake_case_ :       List[str]						,	):
							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."""      )
															UpperCamelCase_:							str	=						CONFIG_MAPPING["""resnet"""](out_features=["""stage4"""]      )
											elif isinstance(snake_case_						,	snake_case_      ):
															UpperCamelCase_:							Tuple	=						backbone_config.get("""model_type"""      )
															UpperCamelCase_:							Dict	=						CONFIG_MAPPING[backbone_model_type]
															UpperCamelCase_:							List[Any]	=						config_class.from_dict(snake_case_      )
							UpperCamelCase_:							Optional[int]	=						use_timm_backbone
							UpperCamelCase_:							Optional[Any]	=						backbone_config
							UpperCamelCase_:							str	=						num_channels
							UpperCamelCase_:							str	=						num_queries
							UpperCamelCase_:							Any	=						max_position_embeddings
							UpperCamelCase_:							str	=						d_model
							UpperCamelCase_:							Union[str, Any]	=						encoder_ffn_dim
							UpperCamelCase_:							int	=						encoder_layers
							UpperCamelCase_:							Tuple	=						encoder_attention_heads
							UpperCamelCase_:							List[str]	=						decoder_ffn_dim
							UpperCamelCase_:							List[Any]	=						decoder_layers
							UpperCamelCase_:							Dict	=						decoder_attention_heads
							UpperCamelCase_:							Any	=						dropout
							UpperCamelCase_:							List[Any]	=						attention_dropout
							UpperCamelCase_:							str	=						activation_dropout
							UpperCamelCase_:							List[Any]	=						activation_function
							UpperCamelCase_:							Tuple	=						init_std
							UpperCamelCase_:							Union[str, Any]	=						init_xavier_std
							UpperCamelCase_:							Dict	=						encoder_layerdrop
							UpperCamelCase_:							List[Any]	=						auxiliary_loss
							UpperCamelCase_:							Optional[int]	=						position_embedding_type
							UpperCamelCase_:							Dict	=						backbone
							UpperCamelCase_:							Optional[int]	=						use_pretrained_backbone
							UpperCamelCase_:							List[Any]	=						dilation
							# deformable attributes
							UpperCamelCase_:							Optional[int]	=						num_feature_levels
							UpperCamelCase_:							Dict	=						encoder_n_points
							UpperCamelCase_:							str	=						decoder_n_points
							UpperCamelCase_:							int	=						two_stage
							UpperCamelCase_:							List[Any]	=						two_stage_num_proposals
							UpperCamelCase_:							str	=						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
							UpperCamelCase_:							List[Any]	=						class_cost
							UpperCamelCase_:							List[Any]	=						bbox_cost
							UpperCamelCase_:							List[Any]	=						giou_cost
							# Loss coefficients
							UpperCamelCase_:							List[str]	=						mask_loss_coefficient
							UpperCamelCase_:							Union[str, Any]	=						dice_loss_coefficient
							UpperCamelCase_:							int	=						bbox_loss_coefficient
							UpperCamelCase_:							str	=						giou_loss_coefficient
							UpperCamelCase_:							Any	=						eos_coefficient
							UpperCamelCase_:							int	=						focal_alpha
							UpperCamelCase_:							str	=						disable_custom_kernels
							super().__init__(is_encoder_decoder=snake_case_						,	**snake_case_      )

			@property
			def       lowerCAmelCase__	(       self :       int      ):
							return self.encoder_attention_heads

			@property
			def       lowerCAmelCase__	(       self :       List[str]      ):
							return self.d_model




			def       lowerCAmelCase__	(       self :       List[str]      ):
							UpperCamelCase_:							Dict	=						copy.deepcopy(self.__dict__      )
							if self.backbone_config is not None:
											UpperCamelCase_:							List[Any]	=						self.backbone_config.to_dict()
							UpperCamelCase_:							List[str]	=						self.__class__.model_type
							return output








def        A__					(						lowerCamelCase = 50						)  ->	int:
				UpperCamelCase_:							List[Any]	=						[[0] * 3 for _ in range(length + 1						)]

				for row_length in range(length + 1						):
								for tile_length in range(2     ,    5						):
												for tile_start in range(row_length - tile_length + 1						):
																different_colour_ways_number[row_length][tile_length - 2] += (
																    different_colour_ways_number[row_length - tile_start - tile_length][
																        tile_length - 2
																    ]
																    + 1
																)

				return sum(different_colour_ways_number[length]						)


if __name__ == "__main__":
							print(F"""{solution() = }""")






