

"""simple docstring"""




import copy

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


A_							:     List[Any]     =	logging.get_logger(__name__)

A_							:     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 				lowerCamelCase  (A__     ):

			def __init__(   self			:  Tuple      ,			__UpperCAmelCase			:  Tuple=2_5_6      ,			__UpperCAmelCase			:  Tuple=1_0_2_4      ,			__UpperCAmelCase			:  str=1_6      ,			__UpperCAmelCase			:  str=1_6      ,			__UpperCAmelCase			:  Tuple=4      ,			__UpperCAmelCase			:  Union[str, Any]="gelu"      ,			__UpperCAmelCase			:  Any=1e-6      ,			**__UpperCAmelCase			:  Union[str, Any]      ,			)				->      Optional[int]:
						super().__init__(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= hidden_size
						SCREAMING_SNAKE_CASE__									= image_size
						SCREAMING_SNAKE_CASE__									= patch_size
						SCREAMING_SNAKE_CASE__									= image_size // patch_size
						SCREAMING_SNAKE_CASE__									= mask_input_channels
						SCREAMING_SNAKE_CASE__									= num_point_embeddings
						SCREAMING_SNAKE_CASE__									= hidden_act
						SCREAMING_SNAKE_CASE__									= layer_norm_eps





class 				lowerCamelCase  (A__     ):

			def __init__(   self			:  List[str]      ,			__UpperCAmelCase			:  Optional[int]=2_5_6      ,			__UpperCAmelCase			:  str="relu"      ,			__UpperCAmelCase			:  List[Any]=2_0_4_8      ,			__UpperCAmelCase			:  Union[str, Any]=2      ,			__UpperCAmelCase			:  Union[str, Any]=8      ,			__UpperCAmelCase			:  Any=2      ,			__UpperCAmelCase			:  Any=3      ,			__UpperCAmelCase			:  Optional[int]=3      ,			__UpperCAmelCase			:  Any=2_5_6      ,			__UpperCAmelCase			:  List[str]=1e-6      ,			**__UpperCAmelCase			:  int      ,			)				->      Union[str, Any]:
						super().__init__(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= hidden_size
						SCREAMING_SNAKE_CASE__									= hidden_act
						SCREAMING_SNAKE_CASE__									= mlp_dim
						SCREAMING_SNAKE_CASE__									= num_hidden_layers
						SCREAMING_SNAKE_CASE__									= num_attention_heads
						SCREAMING_SNAKE_CASE__									= attention_downsample_rate
						SCREAMING_SNAKE_CASE__									= num_multimask_outputs
						SCREAMING_SNAKE_CASE__									= iou_head_depth
						SCREAMING_SNAKE_CASE__									= iou_head_hidden_dim
						SCREAMING_SNAKE_CASE__									= layer_norm_eps





class 				lowerCamelCase  (A__     ):

			def __init__(   self			:  Optional[int]      ,			__UpperCAmelCase			:  Optional[Any]=7_6_8      ,			__UpperCAmelCase			:  Any=2_5_6      ,			__UpperCAmelCase			:  List[str]=1_2      ,			__UpperCAmelCase			:  List[Any]=1_2      ,			__UpperCAmelCase			:  Union[str, Any]=3      ,			__UpperCAmelCase			:  Optional[int]=1_0_2_4      ,			__UpperCAmelCase			:  Tuple=1_6      ,			__UpperCAmelCase			:  str="gelu"      ,			__UpperCAmelCase			:  List[Any]=1e-06      ,			__UpperCAmelCase			:  Union[str, Any]=0.0      ,			__UpperCAmelCase			:  Any=1e-10      ,			__UpperCAmelCase			:  Any=True      ,			__UpperCAmelCase			:  List[str]=4.0      ,			__UpperCAmelCase			:  int=True      ,			__UpperCAmelCase			:  Optional[int]=True      ,			__UpperCAmelCase			:  List[str]=1_4      ,			__UpperCAmelCase			:  int=[2, 5, 8, 1_1]      ,			__UpperCAmelCase			:  Union[str, Any]=1_2_8      ,			__UpperCAmelCase			:  str=None      ,			**__UpperCAmelCase			:  List[str]      ,			)				->      List[str]:
						super().__init__(**__UpperCAmelCase    )

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





class 				lowerCamelCase  (A__     ):
			lowerCamelCase__				:						Tuple   						=							'sam'
			lowerCamelCase__				:						Tuple   						=							True

			def __init__(   self			:  int      ,			__UpperCAmelCase			:  Optional[Any]=None      ,			__UpperCAmelCase			:  Optional[Any]=None      ,			__UpperCAmelCase			:  int=None      ,			__UpperCAmelCase			:  Optional[Any]=0.02      ,			**__UpperCAmelCase			:  Any      ,			)				->      Dict:
						super().__init__(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= vision_config if vision_config is not None else {}
						SCREAMING_SNAKE_CASE__									= prompt_encoder_config if prompt_encoder_config is not None else {}
						SCREAMING_SNAKE_CASE__									= mask_decoder_config if mask_decoder_config is not None else {}

						if isinstance(__UpperCAmelCase      ,			__UpperCAmelCase    ):
									SCREAMING_SNAKE_CASE__									= vision_config.to_dict()
						if isinstance(__UpperCAmelCase      ,			__UpperCAmelCase    ):
									SCREAMING_SNAKE_CASE__									= prompt_encoder_config.to_dict()
						if isinstance(__UpperCAmelCase      ,			__UpperCAmelCase    ):
									SCREAMING_SNAKE_CASE__									= mask_decoder_config.to_dict()

						SCREAMING_SNAKE_CASE__									= SamVisionConfig(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= SamPromptEncoderConfig(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= SamMaskDecoderConfig(**__UpperCAmelCase    )
						SCREAMING_SNAKE_CASE__									= initializer_range





			def    SCREAMING_SNAKE_CASE			(   self			:  str    )				->      int:
						SCREAMING_SNAKE_CASE__									= copy.deepcopy(self.__dict__    )
						SCREAMING_SNAKE_CASE__									= self.vision_config.to_dict()
						SCREAMING_SNAKE_CASE__									= self.prompt_encoder_config.to_dict()
						SCREAMING_SNAKE_CASE__									= self.mask_decoder_config.to_dict()
						SCREAMING_SNAKE_CASE__									= self.__class__.model_type
						return output





"""simple docstring"""




def 		A    (       snake_case__						,			snake_case__      ):




			'''simple docstring'''


			return a + b


if __name__ == "__main__":
						A_							:     List[str]     =	5
						A_							:     Optional[int]     =	6
						print(F'The sum of {a} + {b} is {add(a, b)}')


