
'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


a_											=						logging.get_logger(__name__)

a_											=						{
    '''weiweishi/roc-bert-base-zh''': '''https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json''',
}






class    UpperCAmelCase_				(	__a					):
 UpperCAmelCase_		    =						'''roc_bert'''





 def __init__(    self ,       lowercase_=3_05_22 ,       lowercase_=7_68 ,       lowercase_=12 ,       lowercase_=12 ,       lowercase_=30_72 ,       lowercase_="gelu" ,       lowercase_=0.1 ,       lowercase_=0.1 ,       lowercase_=5_12 ,       lowercase_=2 ,       lowercase_=0.02 ,       lowercase_=1E-12 ,       lowercase_=True ,       lowercase_=0 ,       lowercase_="absolute" ,       lowercase_=None ,       lowercase_=True ,       lowercase_=True ,       lowercase_=7_68 ,       lowercase_=9_10 ,       lowercase_=5_12 ,       lowercase_=2_48_58 ,       lowercase_=True ,       **lowercase_ ,       ):
     snake_case_ :    List[str]     			=						vocab_size
     snake_case_ :    Union[str, Any]     			=						max_position_embeddings
     snake_case_ :    Optional[Any]     			=						hidden_size
     snake_case_ :    Tuple     			=						num_hidden_layers
     snake_case_ :    int     			=						num_attention_heads
     snake_case_ :    str     			=						intermediate_size
     snake_case_ :    int     			=						hidden_act
     snake_case_ :    int     			=						hidden_dropout_prob
     snake_case_ :    int     			=						attention_probs_dropout_prob
     snake_case_ :    Dict     			=						initializer_range
     snake_case_ :    Tuple     			=						type_vocab_size
     snake_case_ :    Any     			=						layer_norm_eps
     snake_case_ :    int     			=						use_cache
     snake_case_ :    List[Any]     			=						enable_pronunciation
     snake_case_ :    Optional[Any]     			=						enable_shape
     snake_case_ :    int     			=						pronunciation_embed_dim
     snake_case_ :    str     			=						pronunciation_vocab_size
     snake_case_ :    Tuple     			=						shape_embed_dim
     snake_case_ :    Optional[Any]     			=						shape_vocab_size
     snake_case_ :    Tuple     			=						concat_input
     snake_case_ :    Optional[int]     			=						position_embedding_type
     snake_case_ :    List[str]     			=						classifier_dropout
     super().__init__(pad_token_id=snake_case__ ,       **snake_case__)






'''simple docstring'''
import doctest
from collections import deque

import numpy as np






class    UpperCAmelCase_				:





 def __init__(    self):
     snake_case_ :    List[Any]     			=						[2, 1, 2, -1]
     snake_case_ :    int     			=						[1, 2, 3, 4]





 def        snake_case__		(    self):
     snake_case_ :    str     			=						len(self.first_signal)
     snake_case_ :    Any     			=						len(self.second_signal)

     snake_case_ :    List[Any]     			=						max(lowercase_ ,       lowercase_)

     # create a zero matrix of max_length x max_length
     snake_case_ :    Dict     			=						[[0] * max_length for i in range(lowercase_)]

     # fills the smaller signal with zeros to make both signals of same length
     if length_first_signal < length_second_signal:
         self.first_signal += [0] * (max_length - length_first_signal)
     elif length_first_signal > length_second_signal:
         self.second_signal += [0] * (max_length - length_second_signal)
     for i in range(lowercase_):
         snake_case_ :    List[str]     			=						deque(self.second_signal)
         rotated_signal.rotate(lowercase_)
         for j, item in enumerate(lowercase_):
             matrix[i][j] += item

        # multiply the matrix with the first signal
     snake_case_ :    Any     			=						np.matmul(np.transpose(lowercase_) ,       np.transpose(self.first_signal))

     # rounding-off to two decimal places
     return [round(lowercase_ ,       2) for i in final_signal]


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




