

import functools
import operator

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


UpperCAmelCase__ :     List[Any]				    =    logging.get_logger(__name__)

UpperCAmelCase__ :     Union[str, Any]				    =    {
    """microsoft/wavlm-base""": """https://huggingface.co/microsoft/wavlm-base/resolve/main/config.json""",
    # See all WavLM models at https://huggingface.co/models?filter=wavlm
}







class        a__       (   UpperCAmelCase       ):







  """simple docstring"""




  UpperCAmelCase__      : Optional[int]			       ="""wavlm"""


  def __init__(			self    : str				,				UpperCAmelCase__    : List[str]=3_2				,				UpperCAmelCase__    : Optional[int]=7_6_8				,				UpperCAmelCase__    : List[str]=1_2				,				UpperCAmelCase__    : Optional[Any]=1_2				,				UpperCAmelCase__    : List[Any]=3_0_7_2				,				UpperCAmelCase__    : str="gelu"				,				UpperCAmelCase__    : List[str]=0.1				,				UpperCAmelCase__    : List[Any]=0.1				,				UpperCAmelCase__    : Optional[int]=0.1				,				UpperCAmelCase__    : Any=0.0				,				UpperCAmelCase__    : Dict=0.1				,				UpperCAmelCase__    : Union[str, Any]=0.1				,				UpperCAmelCase__    : Optional[Any]=0.02				,				UpperCAmelCase__    : List[str]=1e-5				,				UpperCAmelCase__    : str="group"				,				UpperCAmelCase__    : Tuple="gelu"				,				UpperCAmelCase__    : int=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)				,				UpperCAmelCase__    : Tuple=(5, 2, 2, 2, 2, 2, 2)				,				UpperCAmelCase__    : Any=(1_0, 3, 3, 3, 3, 2, 2)				,				UpperCAmelCase__    : Dict=False				,				UpperCAmelCase__    : Union[str, Any]=1_2_8				,				UpperCAmelCase__    : Union[str, Any]=1_6				,				UpperCAmelCase__    : Optional[Any]=3_2_0				,				UpperCAmelCase__    : str=8_0_0				,				UpperCAmelCase__    : str=False				,				UpperCAmelCase__    : List[Any]=True				,				UpperCAmelCase__    : List[Any]=0.05				,				UpperCAmelCase__    : int=1_0				,				UpperCAmelCase__    : Union[str, Any]=2				,				UpperCAmelCase__    : Optional[Any]=0.0				,				UpperCAmelCase__    : int=1_0				,				UpperCAmelCase__    : Union[str, Any]=3_2_0				,				UpperCAmelCase__    : Dict=2				,				UpperCAmelCase__    : List[str]=0.1				,				UpperCAmelCase__    : List[str]=1_0_0				,				UpperCAmelCase__    : List[str]=2_5_6				,				UpperCAmelCase__    : Optional[Any]=2_5_6				,				UpperCAmelCase__    : Tuple=0.1				,				UpperCAmelCase__    : Any="mean"				,				UpperCAmelCase__    : List[Any]=False				,				UpperCAmelCase__    : List[str]=False				,				UpperCAmelCase__    : Optional[Any]=2_5_6				,				UpperCAmelCase__    : Any=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)				,				UpperCAmelCase__    : Optional[int]=(5, 3, 3, 1, 1)				,				UpperCAmelCase__    : Tuple=(1, 2, 3, 1, 1)				,				UpperCAmelCase__    : List[Any]=5_1_2				,				UpperCAmelCase__    : int=8_0				,				UpperCAmelCase__    : int=0				,				UpperCAmelCase__    : Tuple=1				,				UpperCAmelCase__    : List[str]=2				,				UpperCAmelCase__    : Any=False				,				UpperCAmelCase__    : int=3				,				UpperCAmelCase__    : Optional[Any]=2				,				UpperCAmelCase__    : Union[str, Any]=3				,				UpperCAmelCase__    : List[str]=None				,				**UpperCAmelCase__    : Dict				,				)					->str:
        """simple docstring"""







        super().__init__(**UpperCAmelCase__				,				pad_token_id=UpperCAmelCase__				,				bos_token_id=UpperCAmelCase__				,				eos_token_id=UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   hidden_size
        SCREAMING_SNAKE_CASE :      Any       =   feat_extract_norm
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   feat_extract_activation
        SCREAMING_SNAKE_CASE :      int       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      List[Any]       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Dict       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      int       =   conv_bias
        SCREAMING_SNAKE_CASE :      List[Any]       =   num_buckets
        SCREAMING_SNAKE_CASE :      int       =   max_bucket_distance
        SCREAMING_SNAKE_CASE :      Tuple       =   num_conv_pos_embeddings
        SCREAMING_SNAKE_CASE :      List[Any]       =   num_conv_pos_embedding_groups
        SCREAMING_SNAKE_CASE :      str       =   len(self.conv_dim		)
        SCREAMING_SNAKE_CASE :      Any       =   num_hidden_layers
        SCREAMING_SNAKE_CASE :      List[str]       =   intermediate_size
        SCREAMING_SNAKE_CASE :      Any       =   hidden_act
        SCREAMING_SNAKE_CASE :      Dict       =   num_attention_heads
        SCREAMING_SNAKE_CASE :      Optional[Any]       =   hidden_dropout
        SCREAMING_SNAKE_CASE :      Any       =   attention_dropout
        SCREAMING_SNAKE_CASE :      Any       =   activation_dropout
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   feat_proj_dropout
        SCREAMING_SNAKE_CASE :      Optional[int]       =   final_dropout
        SCREAMING_SNAKE_CASE :      Tuple       =   layerdrop
        SCREAMING_SNAKE_CASE :      Any       =   layer_norm_eps
        SCREAMING_SNAKE_CASE :      Optional[Any]       =   initializer_range
        SCREAMING_SNAKE_CASE :      Optional[int]       =   num_ctc_classes
        SCREAMING_SNAKE_CASE :      int       =   vocab_size
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   do_stable_layer_norm
        SCREAMING_SNAKE_CASE :      Any       =   use_weighted_layer_sum
        SCREAMING_SNAKE_CASE :      str       =   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
        SCREAMING_SNAKE_CASE :      str       =   apply_spec_augment
        SCREAMING_SNAKE_CASE :      List[Any]       =   mask_time_prob
        SCREAMING_SNAKE_CASE :      Union[str, Any]       =   mask_time_length
        SCREAMING_SNAKE_CASE :      List[str]       =   mask_time_min_masks
        SCREAMING_SNAKE_CASE :      int       =   mask_feature_prob
        SCREAMING_SNAKE_CASE :      Dict       =   mask_feature_length

        # parameters for pretraining with codevector quantized representations
        SCREAMING_SNAKE_CASE :      Optional[int]       =   num_codevectors_per_group
        SCREAMING_SNAKE_CASE :      List[str]       =   num_codevector_groups
        SCREAMING_SNAKE_CASE :      Any       =   contrastive_logits_temperature
        SCREAMING_SNAKE_CASE :      Any       =   num_negatives
        SCREAMING_SNAKE_CASE :      str       =   codevector_dim
        SCREAMING_SNAKE_CASE :      Optional[Any]       =   proj_codevector_dim
        SCREAMING_SNAKE_CASE :      int       =   diversity_loss_weight

        # ctc loss
        SCREAMING_SNAKE_CASE :      List[Any]       =   ctc_loss_reduction
        SCREAMING_SNAKE_CASE :      Optional[int]       =   ctc_zero_infinity

        # adapter
        SCREAMING_SNAKE_CASE :      List[str]       =   add_adapter
        SCREAMING_SNAKE_CASE :      List[Any]       =   adapter_kernel_size
        SCREAMING_SNAKE_CASE :      List[Any]       =   adapter_stride
        SCREAMING_SNAKE_CASE :      List[Any]       =   num_adapter_layers
        SCREAMING_SNAKE_CASE :      Any       =   output_hidden_size or hidden_size

        # SequenceClassification-specific parameter. Feel free to ignore for other classes.
        SCREAMING_SNAKE_CASE :      str       =   classifier_proj_size

        # XVector-specific parameters. Feel free to ignore for other classes.
        SCREAMING_SNAKE_CASE :      Optional[Any]       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Tuple       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      Any       =   list(UpperCAmelCase__		)
        SCREAMING_SNAKE_CASE :      str       =   xvector_output_dim




  @property
  def  _lowercase      (			self    : str		)					->str:
        """simple docstring"""







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







def 					__lowercase      (     _A						,    _A			)     ->						int:
      return int((input_a, input_a).count(1			) != 0			)






def 					__lowercase      (     )     ->						None:
      assert or_gate(0						,    0			) == 0
      assert or_gate(0						,    1			) == 1
      assert or_gate(1						,    0			) == 1
      assert or_gate(1						,    1			) == 1


if __name__ == "__main__":
  print(or_gate(0, 1))
  print(or_gate(1, 0))
  print(or_gate(0, 0))
  print(or_gate(1, 1))




