
import functools
import operator

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


SCREAMING_SNAKE_CASE   :		str					 =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE   :		Union[str, Any]					 =       {
    "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		(					A       ):
					__magic_name__						:							int     	=	'''hubert'''


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





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

									# ctc loss
									A_       	=  ctc_loss_reduction
									A_       	=  ctc_zero_infinity


					@property
					def        lowerCAmelCase_    (	self						)		->							Any:





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

from collections import namedtuple

SCREAMING_SNAKE_CASE   :		Any					 =       namedtuple("from_to", "from_ to")

SCREAMING_SNAKE_CASE   :		str					 =       {
    "atm": from_to(1, 1),
    "pascal": from_to(0.0000098, 10_1325),
    "bar": from_to(0.986923, 1.01325),
    "kilopascal": from_to(0.00986923, 101.325),
    "megapascal": from_to(9.86923, 0.101325),
    "psi": from_to(0.068046, 14.6959),
    "inHg": from_to(0.0334211, 29.9213),
    "torr": from_to(0.00131579, 760),
}



def        lowerCamelCase_  (   __UpperCamelCase ,						__UpperCamelCase ,						__UpperCamelCase     ):
				if from_type not in PRESSURE_CONVERSION:
								raise ValueError(
								    F"Invalid 'from_type' value: {from_type!r}  Supported values are:\n"
								    + ''', '''.join(__UpperCamelCase     )     )
				if to_type not in PRESSURE_CONVERSION:
								raise ValueError(
								    F"Invalid 'to_type' value: {to_type!r}.  Supported values are:\n"
								    + ''', '''.join(__UpperCamelCase     )     )
				return (
				    value * PRESSURE_CONVERSION[from_type].from_ * PRESSURE_CONVERSION[to_type].to
				)


if __name__ == "__main__":
						import doctest

						doctest.testmod()