






"""simple docstring"""



import functools
import operator

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


_snake_case       :      Tuple       =					logging.get_logger(__name__)

_snake_case       :      Optional[int]       =					{
    "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        __lowercase(       _UpperCamelCase  ):
						lowerCAmelCase_		:							Tuple=       """hubert"""






						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="gelu"    ,						_SCREAMING_SNAKE_CASE=0.1    ,						_SCREAMING_SNAKE_CASE=0.1    ,						_SCREAMING_SNAKE_CASE=0.1    ,						_SCREAMING_SNAKE_CASE=True    ,						_SCREAMING_SNAKE_CASE=0.0    ,						_SCREAMING_SNAKE_CASE=0.1    ,						_SCREAMING_SNAKE_CASE=0.1    ,						_SCREAMING_SNAKE_CASE=0.02    ,						_SCREAMING_SNAKE_CASE=1E-5    ,						_SCREAMING_SNAKE_CASE="group"    ,						_SCREAMING_SNAKE_CASE="gelu"    ,						_SCREAMING_SNAKE_CASE=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)    ,						_SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)    ,						_SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)    ,						_SCREAMING_SNAKE_CASE=False    ,						_SCREAMING_SNAKE_CASE=1_28    ,						_SCREAMING_SNAKE_CASE=16    ,						_SCREAMING_SNAKE_CASE=False    ,						_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="sum"    ,						_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    ,						)			->  List[str]:




											"""simple docstring"""





											super().__init__(**_SCREAMING_SNAKE_CASE    ,						pad_token_id=_SCREAMING_SNAKE_CASE    ,						bos_token_id=_SCREAMING_SNAKE_CASE    ,						eos_token_id=_SCREAMING_SNAKE_CASE)
											lowerCamelCase__				=hidden_size
											lowerCamelCase__				=feat_extract_norm
											lowerCamelCase__				=feat_extract_activation
											lowerCamelCase__				=list(_SCREAMING_SNAKE_CASE)
											lowerCamelCase__				=list(_SCREAMING_SNAKE_CASE)
											lowerCamelCase__				=list(_SCREAMING_SNAKE_CASE)
											lowerCamelCase__				=conv_bias
											lowerCamelCase__				=num_conv_pos_embeddings
											lowerCamelCase__				=num_conv_pos_embedding_groups
											lowerCamelCase__				=len(self.conv_dim)
											lowerCamelCase__				=num_hidden_layers
											lowerCamelCase__				=intermediate_size
											lowerCamelCase__				=hidden_act
											lowerCamelCase__				=num_attention_heads
											lowerCamelCase__				=hidden_dropout
											lowerCamelCase__				=attention_dropout
											lowerCamelCase__				=activation_dropout
											lowerCamelCase__				=feat_proj_layer_norm
											lowerCamelCase__				=feat_proj_dropout
											lowerCamelCase__				=final_dropout
											lowerCamelCase__				=layerdrop
											lowerCamelCase__				=layer_norm_eps
											lowerCamelCase__				=initializer_range
											lowerCamelCase__				=vocab_size
											lowerCamelCase__				=do_stable_layer_norm
											lowerCamelCase__				=use_weighted_layer_sum
											lowerCamelCase__				=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
											lowerCamelCase__				=apply_spec_augment
											lowerCamelCase__				=mask_time_prob
											lowerCamelCase__				=mask_time_length
											lowerCamelCase__				=mask_time_min_masks
											lowerCamelCase__				=mask_feature_prob
											lowerCamelCase__				=mask_feature_length
											lowerCamelCase__				=mask_feature_min_masks

											# ctc loss
											lowerCamelCase__				=ctc_loss_reduction
											lowerCamelCase__				=ctc_zero_infinity






						@property
						def 		lowerCAmelCase   (					self)			->  Dict:




											"""simple docstring"""





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







"""simple docstring"""



from doctest import testmod
from math import sqrt




def 						lowerCamelCase_				(  __A  :		int			):
					lowerCamelCase__				=[]
					if num < 1:
										return facs
					facs.append(1			)
					if num == 1:
										return facs
					facs.append(__A			)
					for i in range(2			,	int(sqrt(__A			)			) + 1			):
										if num % i == 0:  # If i is a factor of num
															facs.append(__A			)
															lowerCamelCase__				=num // i  # num//i is the other factor of num
															if d != i:  # If d and i are distinct
																				facs.append(__A			)  # we have found another factor
					facs.sort()
					return facs


if __name__ == "__main__":
						testmod(name="factors_of_a_number", verbose=True)