





import functools
import operator

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


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

__lowerCAmelCase			:List[str]	 =     {
    'facebook/hubert-base-ls960': 'https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json',
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}






class 							_a(     __A     ):
		lowerCamelCase__  :Optional[int] 					=		'hubert'







		def __init__(     self			,    __snake_case=3_2			,    __snake_case=7_6_8			,    __snake_case=1_2			,    __snake_case=1_2			,    __snake_case=3_0_7_2			,    __snake_case="gelu"			,    __snake_case=0.1			,    __snake_case=0.1			,    __snake_case=0.1			,    __snake_case=True			,    __snake_case=0.0			,    __snake_case=0.1			,    __snake_case=0.1			,    __snake_case=0.02			,    __snake_case=1E-5			,    __snake_case="group"			,    __snake_case="gelu"			,    __snake_case=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)			,    __snake_case=(5, 2, 2, 2, 2, 2, 2)			,    __snake_case=(1_0, 3, 3, 3, 3, 2, 2)			,    __snake_case=False			,    __snake_case=1_2_8			,    __snake_case=1_6			,    __snake_case=False			,    __snake_case=True			,    __snake_case=0.05			,    __snake_case=1_0			,    __snake_case=2			,    __snake_case=0.0			,    __snake_case=1_0			,    __snake_case=0			,    __snake_case="sum"			,    __snake_case=False			,    __snake_case=False			,    __snake_case=2_5_6			,    __snake_case=0			,    __snake_case=1			,    __snake_case=2			,    **__snake_case			,    )   ->   Optional[int]:


							'''simple docstring'''

							super().__init__(**__snake_case			,    pad_token_id=__snake_case			,    bos_token_id=__snake_case			,    eos_token_id=__snake_case					)
							_snake_case							:       int												= hidden_size
							_snake_case							:       Dict												= feat_extract_norm
							_snake_case							:       List[str]												= feat_extract_activation
							_snake_case							:       List[Any]												= list(__snake_case					)
							_snake_case							:       Optional[int]												= list(__snake_case					)
							_snake_case							:       Union[str, Any]												= list(__snake_case					)
							_snake_case							:       Optional[int]												= conv_bias
							_snake_case							:       Tuple												= num_conv_pos_embeddings
							_snake_case							:       int												= num_conv_pos_embedding_groups
							_snake_case							:       Union[str, Any]												= len(self.conv_dim					)
							_snake_case							:       List[Any]												= num_hidden_layers
							_snake_case							:       List[Any]												= intermediate_size
							_snake_case							:       List[Any]												= hidden_act
							_snake_case							:       Union[str, Any]												= num_attention_heads
							_snake_case							:       List[str]												= hidden_dropout
							_snake_case							:       Any												= attention_dropout
							_snake_case							:       Optional[int]												= activation_dropout
							_snake_case							:       Tuple												= feat_proj_layer_norm
							_snake_case							:       int												= feat_proj_dropout
							_snake_case							:       List[Any]												= final_dropout
							_snake_case							:       Any												= layerdrop
							_snake_case							:       str												= layer_norm_eps
							_snake_case							:       Dict												= initializer_range
							_snake_case							:       Optional[Any]												= vocab_size
							_snake_case							:       Optional[int]												= do_stable_layer_norm
							_snake_case							:       List[Any]												= use_weighted_layer_sum
							_snake_case							:       int												= classifier_proj_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)`, but is `len(config.conv_dim) ="
												    f""" {len(self.conv_dim					)}`, `len(config.conv_stride) = {len(self.conv_stride					)}`,"""
												    f""" `len(config.conv_kernel) = {len(self.conv_kernel					)}`."""					)

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

							# ctc loss
							_snake_case							:       Any												= ctc_loss_reduction
							_snake_case							:       Tuple												= ctc_zero_infinity







		@property
		def 							lowercase							(     self					)   ->   Dict:


							'''simple docstring'''

							return functools.reduce(operator.mul			,    self.conv_stride			,    1					)






def  A					(				UpperCAmelCase					):
					if not isinstance(UpperCAmelCase	,	UpperCAmelCase					):
										_snake_case							:       Optional[Any]												= F"""Input value of [number={number}] must be an integer"""
										raise TypeError(UpperCAmelCase					)
					if number < 1:
										raise ValueError("Input must be a positive integer"					)
					return number * (2 * number - 1)


if __name__ == "__main__":
							import doctest

							doctest.testmod()