





"""simple docstring"""





import doctest
from collections import deque

import numpy as np






class    _lowerCAmelCase  :
       """simple docstring"""




       def __init__(       self ):



         '''simple docstring'''

         lowerCAmelCase__     :Tuple											=				[2, 1, 2, -1]
         lowerCAmelCase__     :Tuple											=				[1, 2, 3, 4]






       def 	snake_case		(       self ):



         '''simple docstring'''

         lowerCAmelCase__     :int											=				len(self.first_signal )
         lowerCAmelCase__     :Dict											=				len(self.second_signal )

         lowerCAmelCase__     :List[str]											=				max(__UpperCAmelCase       ,					__UpperCAmelCase )

         # create a zero matrix of max_length x max_length
         lowerCAmelCase__     :Optional[Any]											=				[[0] * max_length for i in range(__UpperCAmelCase )]

         # 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(__UpperCAmelCase ):
           lowerCAmelCase__     :int											=				deque(self.second_signal )
           rotated_signal.rotate(__UpperCAmelCase )
           for j, item in enumerate(__UpperCAmelCase ):
             matrix[i][j] += item

        # multiply the matrix with the first signal
         lowerCAmelCase__     :List[str]											=				np.matmul(np.transpose(__UpperCAmelCase )       ,					np.transpose(self.first_signal ) )

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


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






'''simple docstring'''





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


UpperCamelCase_		:     int          =		logging.get_logger(__name__)

UpperCamelCase_		:     Any          =		{
    '''tiiuae/falcon-40b''': '''https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json''',
    '''tiiuae/falcon-7b''': '''https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json''',
}

class   _a							(		__lowerCAmelCase				):
     SCREAMING_SNAKE_CASE_				:       List[str]       							=		"""falcon"""
     SCREAMING_SNAKE_CASE_				:       Optional[int]       							=		["""past_key_values"""]






     def __init__(					self   ,_SCREAMING_SNAKE_CASE=65_024   ,_SCREAMING_SNAKE_CASE=4_544   ,_SCREAMING_SNAKE_CASE=32   ,_SCREAMING_SNAKE_CASE=71   ,_SCREAMING_SNAKE_CASE=1e-5   ,_SCREAMING_SNAKE_CASE=0.0_2   ,_SCREAMING_SNAKE_CASE=True   ,_SCREAMING_SNAKE_CASE=0.0   ,_SCREAMING_SNAKE_CASE=0.0   ,_SCREAMING_SNAKE_CASE=None   ,_SCREAMING_SNAKE_CASE=False   ,_SCREAMING_SNAKE_CASE=False   ,_SCREAMING_SNAKE_CASE=True   ,_SCREAMING_SNAKE_CASE=True   ,_SCREAMING_SNAKE_CASE=False   ,_SCREAMING_SNAKE_CASE=11   ,_SCREAMING_SNAKE_CASE=11   ,**_SCREAMING_SNAKE_CASE   ,)				->     Dict:
          _snake_case				= vocab_size
          # Backward compatibility with n_embed kwarg
          _snake_case				= kwargs.pop("n_embed"   ,_SCREAMING_SNAKE_CASE       )
          _snake_case				= hidden_size if n_embed is None else n_embed
          _snake_case				= num_hidden_layers
          _snake_case				= num_attention_heads
          _snake_case				= layer_norm_epsilon
          _snake_case				= initializer_range
          _snake_case				= use_cache
          _snake_case				= hidden_dropout
          _snake_case				= attention_dropout

          _snake_case				= bos_token_id
          _snake_case				= eos_token_id
          _snake_case				= num_attention_heads if num_kv_heads is None else num_kv_heads
          _snake_case				= alibi
          _snake_case				= new_decoder_architecture
          _snake_case				= multi_query  # Ignored when new_decoder_architecture is True
          _snake_case				= parallel_attn
          _snake_case				= bias

          super().__init__(bos_token_id=_SCREAMING_SNAKE_CASE   ,eos_token_id=_SCREAMING_SNAKE_CASE   ,**_SCREAMING_SNAKE_CASE       )






     @property
     def 							_lowercase      (					self       )				->     Union[str, Any]:
          return self.hidden_size // self.num_attention_heads






     @property
     def 							_lowercase      (					self       )				->     Optional[int]:
          return not self.alibi


