




import copy

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


SCREAMING_SNAKE_CASE_    :       Any       =							logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_    :       List[str]       =							{
    '''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 		__UpperCAmelCase(		lowercase__			):





     """simple docstring"""



     def __init__(   self			:							Dict    ,					A			:							str=2_56    ,					A			:							Optional[Any]=10_24    ,					A			:							List[Any]=16    ,					A			:							Tuple=16    ,					A			:							Optional[Any]=4    ,					A			:							Optional[int]="gelu"    ,					A			:							int=1E-6    ,					**A			:							Any    ,					)      ->      Optional[int]:






         """simple docstring"""
         super().__init__(**A     )
         a__  			=							hidden_size
         a__  			=							image_size
         a__  			=							patch_size
         a__  			=							image_size // patch_size
         a__  			=							mask_input_channels
         a__  			=							num_point_embeddings
         a__  			=							hidden_act
         a__  			=							layer_norm_eps







class 		__UpperCAmelCase(		lowercase__			):





     """simple docstring"""



     def __init__(   self			:							Tuple    ,					A			:							Tuple=2_56    ,					A			:							str="relu"    ,					A			:							Union[str, Any]=20_48    ,					A			:							str=2    ,					A			:							Optional[Any]=8    ,					A			:							Optional[int]=2    ,					A			:							Any=3    ,					A			:							str=3    ,					A			:							Optional[int]=2_56    ,					A			:							Optional[int]=1E-6    ,					**A			:							List[str]    ,					)      ->      Optional[Any]:






         """simple docstring"""
         super().__init__(**A     )
         a__  			=							hidden_size
         a__  			=							hidden_act
         a__  			=							mlp_dim
         a__  			=							num_hidden_layers
         a__  			=							num_attention_heads
         a__  			=							attention_downsample_rate
         a__  			=							num_multimask_outputs
         a__  			=							iou_head_depth
         a__  			=							iou_head_hidden_dim
         a__  			=							layer_norm_eps







class 		__UpperCAmelCase(		lowercase__			):





     """simple docstring"""



     def __init__(   self			:							int    ,					A			:							Optional[Any]=7_68    ,					A			:							Union[str, Any]=2_56    ,					A			:							Dict=12    ,					A			:							List[str]=12    ,					A			:							Union[str, Any]=3    ,					A			:							Union[str, Any]=10_24    ,					A			:							Dict=16    ,					A			:							Tuple="gelu"    ,					A			:							Tuple=1E-06    ,					A			:							Any=0.0    ,					A			:							Union[str, Any]=1E-10    ,					A			:							List[str]=True    ,					A			:							int=4.0    ,					A			:							Dict=True    ,					A			:							Optional[int]=True    ,					A			:							Optional[Any]=14    ,					A			:							Optional[int]=[2, 5, 8, 11]    ,					A			:							Optional[Any]=1_28    ,					A			:							Dict=None    ,					**A			:							Optional[Any]    ,					)      ->      List[str]:






         """simple docstring"""
         super().__init__(**A     )

         a__  			=							hidden_size
         a__  			=							output_channels
         a__  			=							num_hidden_layers
         a__  			=							num_attention_heads
         a__  			=							num_channels
         a__  			=							image_size
         a__  			=							patch_size
         a__  			=							hidden_act
         a__  			=							layer_norm_eps
         a__  			=							attention_dropout
         a__  			=							initializer_range
         a__  			=							qkv_bias
         a__  			=							mlp_ratio
         a__  			=							use_abs_pos
         a__  			=							use_rel_pos
         a__  			=							window_size
         a__  			=							global_attn_indexes
         a__  			=							num_pos_feats
         a__  			=							int(hidden_size * mlp_ratio     ) if mlp_dim is None else mlp_dim







class 		__UpperCAmelCase(		lowercase__			):





     """simple docstring"""



     __UpperCAmelCase						:			int							=     """sam"""
     __UpperCAmelCase						:			Optional[int]							=     True

     def __init__(   self			:							int    ,					A			:							Tuple=None    ,					A			:							Dict=None    ,					A			:							Tuple=None    ,					A			:							Dict=0.0_2    ,					**A			:							Optional[Any]    ,					)      ->      Optional[Any]:






         """simple docstring"""
         super().__init__(**A     )
         a__  			=							vision_config if vision_config is not None else {}
         a__  			=							prompt_encoder_config if prompt_encoder_config is not None else {}
         a__  			=							mask_decoder_config if mask_decoder_config is not None else {}

         if isinstance(A    ,					A     ):
             a__  			=							vision_config.to_dict()
         if isinstance(A    ,					A     ):
             a__  			=							prompt_encoder_config.to_dict()
         if isinstance(A    ,					A     ):
             a__  			=							mask_decoder_config.to_dict()

         a__  			=							SamVisionConfig(**A     )
         a__  			=							SamPromptEncoderConfig(**A     )
         a__  			=							SamMaskDecoderConfig(**A     )
         a__  			=							initializer_range






     def 					__SCREAMING_SNAKE_CASE		(   self			:							Union[str, Any]     )      ->      List[Any]:






         """simple docstring"""
         a__  			=							copy.deepcopy(self.__dict__     )
         a__  			=							self.vision_config.to_dict()
         a__  			=							self.prompt_encoder_config.to_dict()
         a__  			=							self.mask_decoder_config.to_dict()
         a__  			=							self.__class__.model_type
         return output












def 							__lowerCAmelCase			(UpperCAmelCase_		):
    return n * (2 * n - 1)
def 							__lowerCAmelCase			(UpperCAmelCase_		):
    a__  			=							(1 + 24 * n) ** 0.5
    return ((1 + root) / 6) % 1 == 0
def 							__lowerCAmelCase			(UpperCAmelCase_ = 144		):
    a__  			=							start
    a__  			=							hexagonal_num(UpperCAmelCase_		)
    while not is_pentagonal(UpperCAmelCase_		):
        n += 1
        a__  			=							hexagonal_num(UpperCAmelCase_		)
    return num


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






