
'''simple docstring'''







import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowercase				:						Optional[Any]												= logging.get_logger(__name__)

_lowercase				:						Union[str, Any]												= {
    "facebook/sam-vit-huge": "https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json",
    "facebook/sam-vit-large": "https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json",
    "facebook/sam-vit-base": "https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json",
}






class 				lowerCAmelCase__     (						A_  ):






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE=2_56       ,							__SCREAMING_SNAKE_CASE=10_24       ,							__SCREAMING_SNAKE_CASE=16       ,							__SCREAMING_SNAKE_CASE=16       ,							__SCREAMING_SNAKE_CASE=4       ,							__SCREAMING_SNAKE_CASE="gelu"       ,							__SCREAMING_SNAKE_CASE=1E-6       ,							**__SCREAMING_SNAKE_CASE       ,							):


											"""simple docstring"""





											super().__init__(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Union[str, Any]									= hidden_size
											lowercase_			:  Optional[Any]									= image_size
											lowercase_			:  Tuple									= patch_size
											lowercase_			:  List[str]									= image_size // patch_size
											lowercase_			:  Optional[Any]									= mask_input_channels
											lowercase_			:  str									= num_point_embeddings
											lowercase_			:  List[Any]									= hidden_act
											lowercase_			:  Union[str, Any]									= layer_norm_eps







class 				lowerCAmelCase__     (						A_  ):






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE=2_56       ,							__SCREAMING_SNAKE_CASE="relu"       ,							__SCREAMING_SNAKE_CASE=20_48       ,							__SCREAMING_SNAKE_CASE=2       ,							__SCREAMING_SNAKE_CASE=8       ,							__SCREAMING_SNAKE_CASE=2       ,							__SCREAMING_SNAKE_CASE=3       ,							__SCREAMING_SNAKE_CASE=3       ,							__SCREAMING_SNAKE_CASE=2_56       ,							__SCREAMING_SNAKE_CASE=1E-6       ,							**__SCREAMING_SNAKE_CASE       ,							):


											"""simple docstring"""





											super().__init__(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  List[Any]									= hidden_size
											lowercase_			:  Optional[int]									= hidden_act
											lowercase_			:  Union[str, Any]									= mlp_dim
											lowercase_			:  Optional[int]									= num_hidden_layers
											lowercase_			:  List[str]									= num_attention_heads
											lowercase_			:  Dict									= attention_downsample_rate
											lowercase_			:  Optional[Any]									= num_multimask_outputs
											lowercase_			:  Optional[Any]									= iou_head_depth
											lowercase_			:  Dict									= iou_head_hidden_dim
											lowercase_			:  List[str]									= layer_norm_eps







class 				lowerCAmelCase__     (						A_  ):






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE=7_68       ,							__SCREAMING_SNAKE_CASE=2_56       ,							__SCREAMING_SNAKE_CASE=12       ,							__SCREAMING_SNAKE_CASE=12       ,							__SCREAMING_SNAKE_CASE=3       ,							__SCREAMING_SNAKE_CASE=10_24       ,							__SCREAMING_SNAKE_CASE=16       ,							__SCREAMING_SNAKE_CASE="gelu"       ,							__SCREAMING_SNAKE_CASE=1E-0_6       ,							__SCREAMING_SNAKE_CASE=0.0       ,							__SCREAMING_SNAKE_CASE=1E-1_0       ,							__SCREAMING_SNAKE_CASE=True       ,							__SCREAMING_SNAKE_CASE=4.0       ,							__SCREAMING_SNAKE_CASE=True       ,							__SCREAMING_SNAKE_CASE=True       ,							__SCREAMING_SNAKE_CASE=14       ,							__SCREAMING_SNAKE_CASE=[2, 5, 8, 11]       ,							__SCREAMING_SNAKE_CASE=1_28       ,							__SCREAMING_SNAKE_CASE=None       ,							**__SCREAMING_SNAKE_CASE       ,							):


											"""simple docstring"""





											super().__init__(**__SCREAMING_SNAKE_CASE	)

											lowercase_			:  Union[str, Any]									= hidden_size
											lowercase_			:  Optional[int]									= output_channels
											lowercase_			:  Dict									= num_hidden_layers
											lowercase_			:  str									= num_attention_heads
											lowercase_			:  Dict									= num_channels
											lowercase_			:  List[Any]									= image_size
											lowercase_			:  int									= patch_size
											lowercase_			:  Optional[Any]									= hidden_act
											lowercase_			:  Any									= layer_norm_eps
											lowercase_			:  Any									= attention_dropout
											lowercase_			:  Optional[int]									= initializer_range
											lowercase_			:  List[str]									= qkv_bias
											lowercase_			:  Optional[Any]									= mlp_ratio
											lowercase_			:  Optional[Any]									= use_abs_pos
											lowercase_			:  List[Any]									= use_rel_pos
											lowercase_			:  str									= window_size
											lowercase_			:  Tuple									= global_attn_indexes
											lowercase_			:  List[Any]									= num_pos_feats
											lowercase_			:  int									= int(hidden_size * mlp_ratio	) if mlp_dim is None else mlp_dim







class 				lowerCAmelCase__     (						A_  ):
					lowerCAmelCase_       =  '''sam'''
					lowerCAmelCase_       =  True






					def __init__(     self       ,							__SCREAMING_SNAKE_CASE=None       ,							__SCREAMING_SNAKE_CASE=None       ,							__SCREAMING_SNAKE_CASE=None       ,							__SCREAMING_SNAKE_CASE=0.02       ,							**__SCREAMING_SNAKE_CASE       ,							):


											"""simple docstring"""





											super().__init__(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Optional[int]									= vision_config if vision_config is not None else {}
											lowercase_			:  Any									= prompt_encoder_config if prompt_encoder_config is not None else {}
											lowercase_			:  Optional[Any]									= mask_decoder_config if mask_decoder_config is not None else {}

											if isinstance(__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):
																	lowercase_			:  Dict									= vision_config.to_dict()
											if isinstance(__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):
																	lowercase_			:  List[str]									= prompt_encoder_config.to_dict()
											if isinstance(__SCREAMING_SNAKE_CASE       ,							__SCREAMING_SNAKE_CASE	):
																	lowercase_			:  Optional[int]									= mask_decoder_config.to_dict()

											lowercase_			:  Union[str, Any]									= SamVisionConfig(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Optional[Any]									= SamPromptEncoderConfig(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  List[Any]									= SamMaskDecoderConfig(**__SCREAMING_SNAKE_CASE	)
											lowercase_			:  Union[str, Any]									= initializer_range






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= copy.deepcopy(self.__dict__	)
											lowercase_			:  int									= self.vision_config.to_dict()
											lowercase_			:  Optional[int]									= self.prompt_encoder_config.to_dict()
											lowercase_			:  List[Any]									= self.mask_decoder_config.to_dict()
											lowercase_			:  List[Any]									= self.__class__.model_type
											return output






'''simple docstring'''







def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 998001							):



						"""simple docstring"""





						lowercase_			:  Dict									= 0
						for i in range(999   ,   99   ,   -1							):  # 3 digit numbers range from 999 down to 100
												for j in range(999   ,   99   ,   -1							):
																		lowercase_			:  int									= str(i * j							)
																		if product_string == product_string[::-1] and i * j < n:
																								lowercase_			:  str									= max(__SCREAMING_SNAKE_CASE   ,   i * j							)
						return answer


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



