





"""simple docstring"""





import copy

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


SCREAMING_SNAKE_CASE__ =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__ =       {
    "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 		lowercase ( _UpperCAmelCase ):





      def __init__(	self				,						lowercase=256				,						lowercase=1_024				,						lowercase=16				,						lowercase=16				,						lowercase=4				,						lowercase="gelu"				,						lowercase=1e-6				,						**lowercase				,						)		->					Tuple:
            super().__init__(**lowercase			)
            lowerCAmelCase  						=	hidden_size
            lowerCAmelCase  						=	image_size
            lowerCAmelCase  						=	patch_size
            lowerCAmelCase  						=	image_size // patch_size
            lowerCAmelCase  						=	mask_input_channels
            lowerCAmelCase  						=	num_point_embeddings
            lowerCAmelCase  						=	hidden_act
            lowerCAmelCase  						=	layer_norm_eps







class 		lowercase ( _UpperCAmelCase ):





      def __init__(	self				,						lowercase=256				,						lowercase="relu"				,						lowercase=2_048				,						lowercase=2				,						lowercase=8				,						lowercase=2				,						lowercase=3				,						lowercase=3				,						lowercase=256				,						lowercase=1e-6				,						**lowercase				,						)		->					List[str]:
            super().__init__(**lowercase			)
            lowerCAmelCase  						=	hidden_size
            lowerCAmelCase  						=	hidden_act
            lowerCAmelCase  						=	mlp_dim
            lowerCAmelCase  						=	num_hidden_layers
            lowerCAmelCase  						=	num_attention_heads
            lowerCAmelCase  						=	attention_downsample_rate
            lowerCAmelCase  						=	num_multimask_outputs
            lowerCAmelCase  						=	iou_head_depth
            lowerCAmelCase  						=	iou_head_hidden_dim
            lowerCAmelCase  						=	layer_norm_eps







class 		lowercase ( _UpperCAmelCase ):





      def __init__(	self				,						lowercase=768				,						lowercase=256				,						lowercase=12				,						lowercase=12				,						lowercase=3				,						lowercase=1_024				,						lowercase=16				,						lowercase="gelu"				,						lowercase=1e-06				,						lowercase=0.0				,						lowercase=1e-10				,						lowercase=True				,						lowercase=4.0				,						lowercase=True				,						lowercase=True				,						lowercase=14				,						lowercase=[2, 5, 8, 11]				,						lowercase=128				,						lowercase=None				,						**lowercase				,						)		->					Optional[Any]:
            super().__init__(**lowercase			)

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







class 		lowercase ( _UpperCAmelCase ):
      _SCREAMING_SNAKE_CASE         =				'sam'
      _SCREAMING_SNAKE_CASE         =				True





      def __init__(	self				,						lowercase=None				,						lowercase=None				,						lowercase=None				,						lowercase=0.02				,						**lowercase				,						)		->					Union[str, Any]:
            super().__init__(**lowercase			)
            lowerCAmelCase  						=	vision_config if vision_config is not None else {}
            lowerCAmelCase  						=	prompt_encoder_config if prompt_encoder_config is not None else {}
            lowerCAmelCase  						=	mask_decoder_config if mask_decoder_config is not None else {}

            if isinstance(lowercase				,						lowercase			):
                  lowerCAmelCase  						=	vision_config.to_dict()
            if isinstance(lowercase				,						lowercase			):
                  lowerCAmelCase  						=	prompt_encoder_config.to_dict()
            if isinstance(lowercase				,						lowercase			):
                  lowerCAmelCase  						=	mask_decoder_config.to_dict()

            lowerCAmelCase  						=	SamVisionConfig(**lowercase			)
            lowerCAmelCase  						=	SamPromptEncoderConfig(**lowercase			)
            lowerCAmelCase  						=	SamMaskDecoderConfig(**lowercase			)
            lowerCAmelCase  						=	initializer_range





      def    _snake_case      (	self			)		->					Optional[Any]:
            lowerCAmelCase  						=	copy.deepcopy(self.__dict__			)
            lowerCAmelCase  						=	self.vision_config.to_dict()
            lowerCAmelCase  						=	self.prompt_encoder_config.to_dict()
            lowerCAmelCase  						=	self.mask_decoder_config.to_dict()
            lowerCAmelCase  						=	self.__class__.model_type
            return output













"""simple docstring"""





from scipy.constants import g


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						float							,						SCREAMING_SNAKE_CASE					:						float      ):







      '''simple docstring'''




      if mass < 0:
            # handling of negative values of mass
            raise ValueError("""The mass of a body cannot be negative"""      )
      if height < 0:
            # handling of negative values of height
            raise ValueError("""The height above the ground cannot be negative"""      )
      return mass * g * height


if __name__ == "__main__":
       from doctest import testmod

       testmod(name="potential_energy")






