

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


__A			:					Optional[Any]						=			logging.get_logger(__name__)

__A			:					List[str]						=			{
    'speechbrain/m-ctc-t-large': 'https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json',
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}





class 			_SCREAMING_SNAKE_CASE (   __snake_case		):







   '''simple docstring'''




   lowerCamelCase__				=      "mctct"





   def __init__(       self					:			List[Any]     , __lowerCamelCase					:			int=8065     , __lowerCamelCase					:			List[Any]=1536     , __lowerCamelCase					:			Dict=36     , __lowerCamelCase					:			Optional[int]=6144     , __lowerCamelCase					:			Union[str, Any]=4     , __lowerCamelCase					:			Any=384     , __lowerCamelCase					:			List[str]=920     , __lowerCamelCase					:			Optional[int]=1e-5     , __lowerCamelCase					:			Tuple=0.3     , __lowerCamelCase					:			Any="relu"     , __lowerCamelCase					:			Optional[int]=0.02     , __lowerCamelCase					:			Any=0.3     , __lowerCamelCase					:			Any=0.3     , __lowerCamelCase					:			List[Any]=1     , __lowerCamelCase					:			str=0     , __lowerCamelCase					:			Dict=2     , __lowerCamelCase					:			Optional[int]=1     , __lowerCamelCase					:			Optional[Any]=0.3     , __lowerCamelCase					:			Any=1     , __lowerCamelCase					:			Dict=(7,)     , __lowerCamelCase					:			Dict=(3,)     , __lowerCamelCase					:			int=80     , __lowerCamelCase					:			Dict=1     , __lowerCamelCase					:			Any=None     , __lowerCamelCase					:			Optional[Any]="sum"     , __lowerCamelCase					:			Dict=False     , **__lowerCamelCase					:			Tuple     , ):
       super().__init__(**__lowerCamelCase     , pad_token_id=__lowerCamelCase     , bos_token_id=__lowerCamelCase     , eos_token_id=__lowerCamelCase			)
       SCREAMING_SNAKE_CASE										=   vocab_size
       SCREAMING_SNAKE_CASE										=   hidden_size
       SCREAMING_SNAKE_CASE										=   num_hidden_layers
       SCREAMING_SNAKE_CASE										=   intermediate_size
       SCREAMING_SNAKE_CASE										=   num_attention_heads
       SCREAMING_SNAKE_CASE										=   attention_head_dim
       SCREAMING_SNAKE_CASE										=   max_position_embeddings
       SCREAMING_SNAKE_CASE										=   layer_norm_eps
       SCREAMING_SNAKE_CASE										=   layerdrop
       SCREAMING_SNAKE_CASE										=   hidden_act
       SCREAMING_SNAKE_CASE										=   initializer_range
       SCREAMING_SNAKE_CASE										=   hidden_dropout_prob
       SCREAMING_SNAKE_CASE										=   attention_probs_dropout_prob
       SCREAMING_SNAKE_CASE										=   pad_token_id
       SCREAMING_SNAKE_CASE										=   bos_token_id
       SCREAMING_SNAKE_CASE										=   eos_token_id
       SCREAMING_SNAKE_CASE										=   conv_glu_dim
       SCREAMING_SNAKE_CASE										=   conv_dropout
       SCREAMING_SNAKE_CASE										=   num_conv_layers
       SCREAMING_SNAKE_CASE										=   input_feat_per_channel
       SCREAMING_SNAKE_CASE										=   input_channels
       SCREAMING_SNAKE_CASE										=   conv_channels
       SCREAMING_SNAKE_CASE										=   ctc_loss_reduction
       SCREAMING_SNAKE_CASE										=   ctc_zero_infinity

       # prevents config testing fail with exporting to json
       SCREAMING_SNAKE_CASE										=   list(__lowerCamelCase			)
       SCREAMING_SNAKE_CASE										=   list(__lowerCamelCase			)

       if len(self.conv_kernel			) != self.num_conv_layers:
           raise ValueError(
               "Configuration for convolutional module is incorrect. "
               "It is required that `len(config.conv_kernel)` == `config.num_conv_layers` "
               f"but is `len(config.conv_kernel) = {len(self.conv_kernel			)}`, "
               f"`config.num_conv_layers = {self.num_conv_layers}`."			)


from typing import Any

import numpy as np





def 	__a     (      A__			:  np.ndarray       ):
    return np.array_equal(A__			,  matrix.conjugate().T       )





def 	__a     (      A__			:  np.ndarray			,  A__			:  np.ndarray       ):
    SCREAMING_SNAKE_CASE										=   v.conjugate().T
    SCREAMING_SNAKE_CASE										=   v_star.dot(A__       )
    assert isinstance(A__			,  np.ndarray       )
    return (v_star_dot.dot(A__       )) / (v_star.dot(A__       ))





def 	__a     (      ):
    SCREAMING_SNAKE_CASE										=   np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]       )
    SCREAMING_SNAKE_CASE										=   np.array([[1], [2], [3]]       )
    assert is_hermitian(A__       ), F"{a} is not hermitian."
    print(rayleigh_quotient(A__			,  A__       )       )

    SCREAMING_SNAKE_CASE										=   np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]       )
    assert is_hermitian(A__       ), F"{a} is not hermitian."
    assert rayleigh_quotient(A__			,  A__       ) == float(3       )


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    tests()