



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


UpperCAmelCase_							:      str      =  logging.get_logger(__name__)

UpperCAmelCase_							:      int      =  {
    "alibaba-damo/mgp-str-base": "https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json",
}






class      UpperCamelCase    (						_UpperCAmelCase     ):
	lowerCAmelCase	:   Optional[int]				=	"""mgp-str"""



	def __init__(       self			,	UpperCAmelCase__=[32, 128]			,	UpperCAmelCase__=4			,	UpperCAmelCase__=3			,	UpperCAmelCase__=27			,	UpperCAmelCase__=38			,	UpperCAmelCase__=50_257			,	UpperCAmelCase__=30_522			,	UpperCAmelCase__=768			,	UpperCAmelCase__=12			,	UpperCAmelCase__=12			,	UpperCAmelCase__=4.0			,	UpperCAmelCase__=True			,	UpperCAmelCase__=False			,	UpperCAmelCase__=1e-5			,	UpperCAmelCase__=0.0			,	UpperCAmelCase__=0.0			,	UpperCAmelCase__=0.0			,	UpperCAmelCase__=False			,	UpperCAmelCase__=0.02			,	**UpperCAmelCase__			,	):
							super().__init__(**UpperCAmelCase__		)

							A__							=       image_size
							A__							=       patch_size
							A__							=       num_channels
							A__							=       max_token_length
							A__							=       num_character_labels
							A__							=       num_bpe_labels
							A__							=       num_wordpiece_labels
							A__							=       hidden_size
							A__							=       num_hidden_layers
							A__							=       num_attention_heads
							A__							=       mlp_ratio
							A__							=       distilled
							A__							=       layer_norm_eps
							A__							=       drop_rate
							A__							=       qkv_bias
							A__							=       attn_drop_rate
							A__							=       drop_path_rate
							A__							=       output_aa_attentions
							A__							=       initializer_range










import math
def  UpperCamelCase						(       _A			:				float			,							_A			:				float    )->       float:





						"""simple docstring"""





						if (
						    not isinstance(_A			,							(int, float)    )
						    or power_factor < -1
						    or power_factor > 1
						):
												raise ValueError("power_factor must be a valid float value between -1 and 1."    )
						return apparent_power * power_factor
def  UpperCamelCase						(       _A			:				float			,							_A			:				float    )->       float:





						"""simple docstring"""





						if (
						    not isinstance(_A			,							(int, float)    )
						    or power_factor < -1
						    or power_factor > 1
						):
												raise ValueError("power_factor must be a valid float value between -1 and 1."    )
						return apparent_power * math.sqrt(1 - power_factor**2    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()





