


import functools
import operator

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


lowercase_           =	logging.get_logger(__name__)

lowercase_           =	{
    'facebook/hubert-base-ls960': 'https://huggingface.co/facebook/hubert-base-ls960/resolve/main/config.json',
    # See all Hubert models at https://huggingface.co/models?filter=hubert
}


class        A_					(       __UpperCamelCase    ):




      '''simple docstring'''


      __snake_case					       =   """hubert"""




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

       # ctc loss
       __lowerCamelCase		:							Union[str, Any]							=						ctc_loss_reduction
       __lowerCamelCase		:							Any							=						ctc_zero_infinity




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





import doctest

import projectq
from projectq.ops import H, Measure
def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__						):
 __lowerCamelCase		:							int							=						quantum_engine.allocate_qubit()
 H | qubit
 Measure | qubit
 return int(SCREAMING_SNAKE_CASE__						)


if __name__ == "__main__":
       doctest.testmod()

       # initialises a new quantum backend
       lowercase_           =	projectq.MainEngine()

       # Generate a list of 10 random numbers
       lowercase_           =	[get_random_number(quantum_engine) for _ in range(1_0)]

       # Flushes the quantum engine from memory
       quantum_engine.flush()

       print('Random numbers', random_numbers_list)

