


'''simple docstring'''
import functools
import operator

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


lowerCAmelCase						=					logging.get_logger(__name__)

lowerCAmelCase						=					{
    """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        lowerCAmelCase_  (     UpperCAmelCase	):
       __UpperCAmelCase					='sew'






       def __init__( self			,     _UpperCamelCase=32			,     _UpperCamelCase=768			,     _UpperCamelCase=12			,     _UpperCamelCase=12			,     _UpperCamelCase=3072			,     _UpperCamelCase=2			,     _UpperCamelCase="gelu"			,     _UpperCamelCase=0.1			,     _UpperCamelCase=0.1			,     _UpperCamelCase=0.1			,     _UpperCamelCase=0.0			,     _UpperCamelCase=0.1			,     _UpperCamelCase=0.1			,     _UpperCamelCase=0.02			,     _UpperCamelCase=1e-5			,     _UpperCamelCase="group"			,     _UpperCamelCase="gelu"			,     _UpperCamelCase=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)			,     _UpperCamelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)			,     _UpperCamelCase=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)			,     _UpperCamelCase=False			,     _UpperCamelCase=128			,     _UpperCamelCase=16			,     _UpperCamelCase=True			,     _UpperCamelCase=0.05			,     _UpperCamelCase=10			,     _UpperCamelCase=2			,     _UpperCamelCase=0.0			,     _UpperCamelCase=10			,     _UpperCamelCase=0			,     _UpperCamelCase="mean"			,     _UpperCamelCase=False			,     _UpperCamelCase=False			,     _UpperCamelCase=256			,     _UpperCamelCase=0			,     _UpperCamelCase=1			,     _UpperCamelCase=2			,     **_UpperCamelCase			,     )->      Tuple:
            super().__init__(**_UpperCamelCase			,     pad_token_id=_UpperCamelCase			,     bos_token_id=_UpperCamelCase			,     eos_token_id=_UpperCamelCase   )
            _A				=							hidden_size
            _A				=							feat_extract_norm
            _A				=							feat_extract_activation
            _A				=							list(_UpperCamelCase   )
            _A				=							list(_UpperCamelCase   )
            _A				=							list(_UpperCamelCase   )
            _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				=							squeeze_factor
            _A				=							hidden_act
            _A				=							num_attention_heads
            _A				=							hidden_dropout
            _A				=							attention_dropout
            _A				=							activation_dropout
            _A				=							feat_proj_dropout
            _A				=							final_dropout
            _A				=							layerdrop
            _A				=							layer_norm_eps
            _A				=							initializer_range
            _A				=							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				=							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

            # sequence classification
            _A				=							use_weighted_layer_sum
            _A				=							classifier_proj_size






       @property
       def   UpperCamelCase						( self   )->      Tuple:
            return functools.reduce(operator.mul			,     self.conv_stride			,     1   )









'''simple docstring'''
def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	bool:







     """simple docstring"""
     if num < 0:
          return False

     _A				=							num
     _A				=							0
     while num > 0:
          _A				=							rev_num * 1_0 + (num % 1_0)
          num //= 1_0

     return num_copy == rev_num


if __name__ == "__main__":
    import doctest

    doctest.testmod()





