


import functools
import operator

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


snake_case    :   str	    =					logging.get_logger(__name__)

snake_case    :   List[str]	    =					{
    '''asapp/sew-tiny-100k''': '''https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json''',
    # See all SEW models at https://huggingface.co/models?filter=sew
}







class 		_snake_case  (				_snake_case							):
 SCREAMING_SNAKE_CASE__				=	'sew'




 def __init__(		self ,  _lowerCamelCase=32 ,  _lowerCamelCase=768 ,  _lowerCamelCase=12 ,  _lowerCamelCase=12 ,  _lowerCamelCase=3072 ,  _lowerCamelCase=2 ,  _lowerCamelCase="gelu" ,  _lowerCamelCase=0.1 ,  _lowerCamelCase=0.1 ,  _lowerCamelCase=0.1 ,  _lowerCamelCase=0.0 ,  _lowerCamelCase=0.1 ,  _lowerCamelCase=0.1 ,  _lowerCamelCase=0.02 ,  _lowerCamelCase=1e-5 ,  _lowerCamelCase="group" ,  _lowerCamelCase="gelu" ,  _lowerCamelCase=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512) ,  _lowerCamelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,  _lowerCamelCase=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,  _lowerCamelCase=False ,  _lowerCamelCase=128 ,  _lowerCamelCase=16 ,  _lowerCamelCase=True ,  _lowerCamelCase=0.05 ,  _lowerCamelCase=10 ,  _lowerCamelCase=2 ,  _lowerCamelCase=0.0 ,  _lowerCamelCase=10 ,  _lowerCamelCase=0 ,  _lowerCamelCase="mean" ,  _lowerCamelCase=False ,  _lowerCamelCase=False ,  _lowerCamelCase=256 ,  _lowerCamelCase=0 ,  _lowerCamelCase=1 ,  _lowerCamelCase=2 ,  **_lowerCamelCase ,  ):
       super().__init__(**_lowerCamelCase ,  pad_token_id=_lowerCamelCase ,  bos_token_id=_lowerCamelCase ,  eos_token_id=_lowerCamelCase   )
       a						:List[Any]										=	hidden_size
       a						:str										=	feat_extract_norm
       a						:List[Any]										=	feat_extract_activation
       a						:Any										=	list(_lowerCamelCase   )
       a						:str										=	list(_lowerCamelCase   )
       a						:int										=	list(_lowerCamelCase   )
       a						:Any										=	conv_bias
       a						:int										=	num_conv_pos_embeddings
       a						:Tuple										=	num_conv_pos_embedding_groups
       a						:Dict										=	len(self.conv_dim   )
       a						:int										=	num_hidden_layers
       a						:Optional[Any]										=	intermediate_size
       a						:List[Any]										=	squeeze_factor
       a						:List[str]										=	hidden_act
       a						:List[str]										=	num_attention_heads
       a						:str										=	hidden_dropout
       a						:Union[str, Any]										=	attention_dropout
       a						:Union[str, Any]										=	activation_dropout
       a						:Optional[Any]										=	feat_proj_dropout
       a						:Optional[int]										=	final_dropout
       a						:str										=	layerdrop
       a						:str										=	layer_norm_eps
       a						:int										=	initializer_range
       a						:int										=	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
       a						:str										=	apply_spec_augment
       a						:Union[str, Any]										=	mask_time_prob
       a						:Any										=	mask_time_length
       a						:int										=	mask_time_min_masks
       a						:List[str]										=	mask_feature_prob
       a						:Optional[Any]										=	mask_feature_length
       a						:int										=	mask_feature_min_masks

       # ctc loss
       a						:Any										=	ctc_loss_reduction
       a						:str										=	ctc_zero_infinity

       # sequence classification
       a						:List[Any]										=	use_weighted_layer_sum
       a						:Union[str, Any]										=	classifier_proj_size




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









def     __lowerCamelCase						(			UpperCAmelCase_						:		int						):




      """simple docstring"""





      if not isinstance(UpperCAmelCase_			,  UpperCAmelCase_						):
            raise TypeError('''Input value must be an \'int\' type'''						)

      a						:Optional[int]										=	0
      while number:
            position += 1
            number >>= 1

      return position


if __name__ == "__main__":
     import doctest

     doctest.testmod()





