
import functools
import operator

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


_A		     =    logging.get_logger(__name__)

_A		     =    {
    '''asapp/sew-d-tiny-100k''': '''https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json''',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}

class 						lowercase_				(				lowercase__ ):
 A__  : str      					=			'''sew-d'''

 def __init__(					self   ,		__UpperCamelCase=3_2   ,		__UpperCamelCase=7_6_8   ,		__UpperCamelCase=1_2   ,		__UpperCamelCase=1_2   ,		__UpperCamelCase=3_0_7_2   ,		__UpperCamelCase=2   ,		__UpperCamelCase=5_1_2   ,		__UpperCamelCase=2_5_6   ,		__UpperCamelCase=True   ,		__UpperCamelCase=True   ,		__UpperCamelCase=("p2c", "c2p")   ,		__UpperCamelCase="layer_norm"   ,		__UpperCamelCase="gelu_python"   ,		__UpperCamelCase=0.1   ,		__UpperCamelCase=0.1   ,		__UpperCamelCase=0.1   ,		__UpperCamelCase=0.0   ,		__UpperCamelCase=0.1   ,		__UpperCamelCase=0.02   ,		__UpperCamelCase=1e-7   ,		__UpperCamelCase=1e-5   ,		__UpperCamelCase="group"   ,		__UpperCamelCase="gelu"   ,		__UpperCamelCase=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2)   ,		__UpperCamelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)   ,		__UpperCamelCase=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)   ,		__UpperCamelCase=False   ,		__UpperCamelCase=1_2_8   ,		__UpperCamelCase=1_6   ,		__UpperCamelCase=True   ,		__UpperCamelCase=0.05   ,		__UpperCamelCase=1_0   ,		__UpperCamelCase=2   ,		__UpperCamelCase=0.0   ,		__UpperCamelCase=1_0   ,		__UpperCamelCase=0   ,		__UpperCamelCase="mean"   ,		__UpperCamelCase=False   ,		__UpperCamelCase=False   ,		__UpperCamelCase=2_5_6   ,		__UpperCamelCase=0   ,		__UpperCamelCase=1   ,		__UpperCamelCase=2   ,		**__UpperCamelCase   ,		):




        """simple docstring"""


        super().__init__(**_a   ,		pad_token_id=_a   ,		bos_token_id=_a   ,		eos_token_id=_a   )
        UpperCamelCase_											=				hidden_size
        UpperCamelCase_											=				feat_extract_norm
        UpperCamelCase_											=				feat_extract_activation
        UpperCamelCase_											=				list(_a   )
        UpperCamelCase_											=				list(_a   )
        UpperCamelCase_											=				list(_a   )
        UpperCamelCase_											=				conv_bias
        UpperCamelCase_											=				num_conv_pos_embeddings
        UpperCamelCase_											=				num_conv_pos_embedding_groups
        UpperCamelCase_											=				len(self.conv_dim   )
        UpperCamelCase_											=				num_hidden_layers
        UpperCamelCase_											=				intermediate_size
        UpperCamelCase_											=				squeeze_factor
        UpperCamelCase_											=				max_position_embeddings
        UpperCamelCase_											=				position_buckets
        UpperCamelCase_											=				share_att_key
        UpperCamelCase_											=				relative_attention
        UpperCamelCase_											=				norm_rel_ebd
        UpperCamelCase_											=				list(_a   )
        UpperCamelCase_											=				hidden_act
        UpperCamelCase_											=				num_attention_heads
        UpperCamelCase_											=				hidden_dropout
        UpperCamelCase_											=				attention_dropout
        UpperCamelCase_											=				activation_dropout
        UpperCamelCase_											=				feat_proj_dropout
        UpperCamelCase_											=				final_dropout
        UpperCamelCase_											=				layer_norm_eps
        UpperCamelCase_											=				feature_layer_norm_eps
        UpperCamelCase_											=				initializer_range
        UpperCamelCase_											=				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
        UpperCamelCase_											=				apply_spec_augment
        UpperCamelCase_											=				mask_time_prob
        UpperCamelCase_											=				mask_time_length
        UpperCamelCase_											=				mask_time_min_masks
        UpperCamelCase_											=				mask_feature_prob
        UpperCamelCase_											=				mask_feature_length
        UpperCamelCase_											=				mask_feature_min_masks

        # ctc loss
        UpperCamelCase_											=				ctc_loss_reduction
        UpperCamelCase_											=				ctc_zero_infinity

        # sequence classification
        UpperCamelCase_											=				use_weighted_layer_sum
        UpperCamelCase_											=				classifier_proj_size

 @property
 def lowerCamelCase_ (					self   ):




        """simple docstring"""


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





'''simple docstring'''







import warnings

from ...utils import logging
from .image_processing_videomae import VideoMAEImageProcessor


__lowerCAmelCase         =    logging.get_logger(__name__)







class UpperCAmelCase__	( lowercase__	):





  """simple docstring"""

  def __init__(		self      :     Tuple							,*_a      :     List[str]							,**_a      :     Any       ):


     '''simple docstring'''






     warnings.warn(
         'The class VideoMAEFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
         ' Please use VideoMAEImageProcessor instead.'							,_a							,)
     super().__init__(*_a							,**_a       )



