






"""simple docstring"""







import math

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


_UpperCamelCase	     =    logging.get_logger(__name__)

_UpperCamelCase	     =    {
    """facebook/data2vec-base-960h""": """https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json""",
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}







class    lowerCamelCase__   (			snake_case					):
    SCREAMING_SNAKE_CASE						=     "data2vec-audio"






    def __init__(					self      ,A=32      ,A=768      ,A=12      ,A=12      ,A=3_072      ,A="gelu"      ,A=0.1      ,A=0.1      ,A=0.1      ,A=0.0      ,A=0.1      ,A=0.1      ,A=0.02      ,A=1e-5      ,A="gelu"      ,A=(512, 512, 512, 512, 512, 512, 512)      ,A=(5, 2, 2, 2, 2, 2, 2)      ,A=(10, 3, 3, 3, 3, 2, 2)      ,A=False      ,A=16      ,A=19      ,A=5      ,A=0.05      ,A=10      ,A=2      ,A=0.0      ,A=10      ,A=0      ,A="sum"      ,A=False      ,A=False      ,A=256      ,A=(512, 512, 512, 512, 1_500)      ,A=(5, 3, 3, 1, 1)      ,A=(1, 2, 3, 1, 1)      ,A=512      ,A=0      ,A=1      ,A=2      ,A=False      ,A=3      ,A=2      ,A=3      ,A=None      ,**A      ,):
          super().__init__(**_lowerCAmelCase      ,pad_token_id=_lowerCAmelCase      ,bos_token_id=_lowerCAmelCase      ,eos_token_id=_lowerCAmelCase   )
          UpperCAmelCase							     =			hidden_size
          UpperCAmelCase							     =			feat_extract_activation
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			conv_bias
          UpperCAmelCase							     =			num_conv_pos_embeddings
          UpperCAmelCase							     =			num_conv_pos_embedding_groups
          UpperCAmelCase							     =			conv_pos_kernel_size
          UpperCAmelCase							     =			len(self.conv_dim   )
          UpperCAmelCase							     =			num_hidden_layers
          UpperCAmelCase							     =			intermediate_size
          UpperCAmelCase							     =			hidden_act
          UpperCAmelCase							     =			num_attention_heads
          UpperCAmelCase							     =			hidden_dropout
          UpperCAmelCase							     =			attention_dropout
          UpperCAmelCase							     =			activation_dropout
          UpperCAmelCase							     =			feat_proj_dropout
          UpperCAmelCase							     =			final_dropout
          UpperCAmelCase							     =			layerdrop
          UpperCAmelCase							     =			layer_norm_eps
          UpperCAmelCase							     =			initializer_range
          UpperCAmelCase							     =			vocab_size
          UpperCAmelCase							     =			use_weighted_layer_sum

          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
          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

          # adapter
          UpperCAmelCase							     =			add_adapter
          UpperCAmelCase							     =			adapter_kernel_size
          UpperCAmelCase							     =			adapter_stride
          UpperCAmelCase							     =			num_adapter_layers
          UpperCAmelCase							     =			output_hidden_size or hidden_size

          # SequenceClassification-specific parameter. Feel free to ignore for other classes.
          UpperCAmelCase							     =			classifier_proj_size

          # XVector-specific parameters. Feel free to ignore for other classes.
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			list(_lowerCAmelCase   )
          UpperCAmelCase							     =			xvector_output_dim






    @property
    def 							_UpperCamelCase				(					self   ):
          return math.prod(self.conv_stride   )










'''simple docstring'''


def 						__a(SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       int     ):



    '''simple docstring'''





    return numa ^ numa < 0


if __name__ == "__main__":
       import doctest

       doctest.testmod()


