
"""simple docstring"""







import functools
import operator

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


lowerCamelCase__           =	logging.get_logger(__name__)

lowerCamelCase__           =	{
    """asapp/sew-d-tiny-100k""": """https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json""",
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}




class 				A__ (			_lowerCamelCase):
		A_		: str            =			'sew-d'

		def __init__(   self ,	_SCREAMING_SNAKE_CASE=32 ,	_SCREAMING_SNAKE_CASE=7_68 ,	_SCREAMING_SNAKE_CASE=12 ,	_SCREAMING_SNAKE_CASE=12 ,	_SCREAMING_SNAKE_CASE=30_72 ,	_SCREAMING_SNAKE_CASE=2 ,	_SCREAMING_SNAKE_CASE=5_12 ,	_SCREAMING_SNAKE_CASE=2_56 ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE=("p2c", "c2p") ,	_SCREAMING_SNAKE_CASE="layer_norm" ,	_SCREAMING_SNAKE_CASE="gelu_python" ,	_SCREAMING_SNAKE_CASE=0.1 ,	_SCREAMING_SNAKE_CASE=0.1 ,	_SCREAMING_SNAKE_CASE=0.1 ,	_SCREAMING_SNAKE_CASE=0.0 ,	_SCREAMING_SNAKE_CASE=0.1 ,	_SCREAMING_SNAKE_CASE=0.02 ,	_SCREAMING_SNAKE_CASE=1E-7 ,	_SCREAMING_SNAKE_CASE=1E-5 ,	_SCREAMING_SNAKE_CASE="group" ,	_SCREAMING_SNAKE_CASE="gelu" ,	_SCREAMING_SNAKE_CASE=(64, 1_28, 1_28, 1_28, 1_28, 2_56, 2_56, 2_56, 2_56, 5_12, 5_12, 5_12, 5_12) ,	_SCREAMING_SNAKE_CASE=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,	_SCREAMING_SNAKE_CASE=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,	_SCREAMING_SNAKE_CASE=False ,	_SCREAMING_SNAKE_CASE=1_28 ,	_SCREAMING_SNAKE_CASE=16 ,	_SCREAMING_SNAKE_CASE=True ,	_SCREAMING_SNAKE_CASE=0.05 ,	_SCREAMING_SNAKE_CASE=10 ,	_SCREAMING_SNAKE_CASE=2 ,	_SCREAMING_SNAKE_CASE=0.0 ,	_SCREAMING_SNAKE_CASE=10 ,	_SCREAMING_SNAKE_CASE=0 ,	_SCREAMING_SNAKE_CASE="mean" ,	_SCREAMING_SNAKE_CASE=False ,	_SCREAMING_SNAKE_CASE=False ,	_SCREAMING_SNAKE_CASE=2_56 ,	_SCREAMING_SNAKE_CASE=0 ,	_SCREAMING_SNAKE_CASE=1 ,	_SCREAMING_SNAKE_CASE=2 ,	**_SCREAMING_SNAKE_CASE ,	):
			super().__init__(**__a ,	pad_token_id=__a ,	bos_token_id=__a ,	eos_token_id=__a				)
			__lowerCAmelCase    :		List[str]		    =   hidden_size
			__lowerCAmelCase    :		List[Any]		    =   feat_extract_norm
			__lowerCAmelCase    :		List[Any]		    =   feat_extract_activation
			__lowerCAmelCase    :		Dict		    =   list(__a				)
			__lowerCAmelCase    :		Union[str, Any]		    =   list(__a				)
			__lowerCAmelCase    :		List[str]		    =   list(__a				)
			__lowerCAmelCase    :		Union[str, Any]		    =   conv_bias
			__lowerCAmelCase    :		Union[str, Any]		    =   num_conv_pos_embeddings
			__lowerCAmelCase    :		Optional[int]		    =   num_conv_pos_embedding_groups
			__lowerCAmelCase    :		List[Any]		    =   len(self.conv_dim				)
			__lowerCAmelCase    :		Optional[int]		    =   num_hidden_layers
			__lowerCAmelCase    :		str		    =   intermediate_size
			__lowerCAmelCase    :		Optional[Any]		    =   squeeze_factor
			__lowerCAmelCase    :		List[Any]		    =   max_position_embeddings
			__lowerCAmelCase    :		List[str]		    =   position_buckets
			__lowerCAmelCase    :		int		    =   share_att_key
			__lowerCAmelCase    :		int		    =   relative_attention
			__lowerCAmelCase    :		int		    =   norm_rel_ebd
			__lowerCAmelCase    :		Optional[int]		    =   list(__a				)
			__lowerCAmelCase    :		Union[str, Any]		    =   hidden_act
			__lowerCAmelCase    :		Tuple		    =   num_attention_heads
			__lowerCAmelCase    :		int		    =   hidden_dropout
			__lowerCAmelCase    :		str		    =   attention_dropout
			__lowerCAmelCase    :		Optional[int]		    =   activation_dropout
			__lowerCAmelCase    :		List[Any]		    =   feat_proj_dropout
			__lowerCAmelCase    :		Tuple		    =   final_dropout
			__lowerCAmelCase    :		Optional[int]		    =   layer_norm_eps
			__lowerCAmelCase    :		List[Any]		    =   feature_layer_norm_eps
			__lowerCAmelCase    :		Any		    =   initializer_range
			__lowerCAmelCase    :		Any		    =   vocab_size

			if (
			    (len(self.conv_stride				) != self.num_feat_extract_layers)
			    or (len(self.conv_kernel				) != self.num_feat_extract_layers)
			    or (len(self.conv_dim				) != self.num_feat_extract_layers)
			):
				raise ValueError(
				    'Configuration for convolutional layers is incorrect.'
				    'It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,'
				    f"but is `len(config.conv_dim) = {len(self.conv_dim				)}`, `len(config.conv_stride)"
				    f"= {len(self.conv_stride				)}`, `len(config.conv_kernel) = {len(self.conv_kernel				)}`."				)

			# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
			__lowerCAmelCase    :		List[Any]		    =   apply_spec_augment
			__lowerCAmelCase    :		List[str]		    =   mask_time_prob
			__lowerCAmelCase    :		int		    =   mask_time_length
			__lowerCAmelCase    :		Union[str, Any]		    =   mask_time_min_masks
			__lowerCAmelCase    :		Optional[Any]		    =   mask_feature_prob
			__lowerCAmelCase    :		int		    =   mask_feature_length
			__lowerCAmelCase    :		Optional[int]		    =   mask_feature_min_masks

			# ctc loss
			__lowerCAmelCase    :		Dict		    =   ctc_loss_reduction
			__lowerCAmelCase    :		Any		    =   ctc_zero_infinity

			# sequence classification
			__lowerCAmelCase    :		Optional[Any]		    =   use_weighted_layer_sum
			__lowerCAmelCase    :		Dict		    =   classifier_proj_size







		@property
		def 							__lowerCamelCase							(   self				):
			return functools.reduce(operator.mul ,	self.conv_stride ,	1				)

"""simple docstring"""







def 					__lowerCAmelCase       (_UpperCamelCase ,						_UpperCamelCase	):

	if density <= 0:
		raise ValueError('Impossible fluid density'	)
	if bulk_modulus <= 0:
		raise ValueError('Impossible bulk modulus'	)

	return (bulk_modulus / density) ** 0.5


if __name__ == "__main__":
							import doctest

							doctest.testmod()