





'''simple docstring'''

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


lowercase__		:     str			=							logging.get_logger(__name__)

lowercase__		:     Tuple			=							{
    'facebook/s2t-wav2vec2-large-en-de': (
        'https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json'
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}
class 							__lowerCAmelCase	(       _lowerCamelCase					):






       """simple docstring"""
       _snake_case      :	Tuple									=       'speech_to_text_2'
       _snake_case      :	Union[str, Any]									=       ['past_key_values']
       _snake_case      :	Dict									=       {'num_attention_heads': 'decoder_attention_heads', 'hidden_size': 'd_model'}





       def __init__(				self  :						int			,					lowerCAmelCase__  :						Union[str, Any]=10000			,					lowerCAmelCase__  :						List[Any]=6			,					lowerCAmelCase__  :						Any=2048			,					lowerCAmelCase__  :						Optional[Any]=4			,					lowerCAmelCase__  :						Optional[Any]=0.0			,					lowerCAmelCase__  :						Any=True			,					lowerCAmelCase__  :						List[str]="relu"			,					lowerCAmelCase__  :						Optional[Any]=256			,					lowerCAmelCase__  :						Optional[Any]=0.1			,					lowerCAmelCase__  :						Dict=0.0			,					lowerCAmelCase__  :						int=0.0			,					lowerCAmelCase__  :						List[Any]=0.02			,					lowerCAmelCase__  :						List[Any]=2			,					lowerCAmelCase__  :						Optional[Any]=True			,					lowerCAmelCase__  :						Optional[Any]=1			,					lowerCAmelCase__  :						List[str]=0			,					lowerCAmelCase__  :						Tuple=2			,					lowerCAmelCase__  :						Dict=1024			,					**lowerCAmelCase__  :						Any			,					)       ->	List[Any]:

            '''simple docstring'''




            _UpperCamelCase							       =			vocab_size
            _UpperCamelCase							       =			d_model
            _UpperCamelCase							       =			decoder_ffn_dim
            _UpperCamelCase							       =			decoder_layers
            _UpperCamelCase							       =			decoder_attention_heads
            _UpperCamelCase							       =			dropout
            _UpperCamelCase							       =			attention_dropout
            _UpperCamelCase							       =			activation_dropout
            _UpperCamelCase							       =			activation_function
            _UpperCamelCase							       =			init_std
            _UpperCamelCase							       =			decoder_layerdrop
            _UpperCamelCase							       =			use_cache
            _UpperCamelCase							       =			decoder_layers
            _UpperCamelCase							       =			scale_embedding  # scale factor will be sqrt(d_model) if True
            _UpperCamelCase							       =			max_target_positions

            super().__init__(
                pad_token_id=__UpperCamelCase			,					bos_token_id=__UpperCamelCase			,					eos_token_id=__UpperCamelCase			,					decoder_start_token_id=__UpperCamelCase			,					**__UpperCamelCase			,					)








from collections.abc import Callable

import numpy as np






def  lowerCamelCase_	(      lowerCAmelCase__	:	Callable			,	lowerCAmelCase__	:	float			,	lowerCAmelCase__	:	float			,	lowerCAmelCase__	:	float			,	lowerCAmelCase__	:	float				)       ->							np.array:

							'''simple docstring'''






							A      						=    int(np.ceil((x_end - xa) / step_size				)				)
							A      						=    np.zeros((n + 1,)				)
							A      						=    ya
							A      						=    xa

							for k in range(lowerCAmelCase__				):
														A      						=    y[k] + step_size * ode_func(lowerCAmelCase__			,	y[k]				)
														A      						=    y[k] + (
														    (step_size / 2) * (ode_func(lowerCAmelCase__			,	y[k]				) + ode_func(x + step_size			,	lowerCAmelCase__				))
														)
														x += step_size

							return y


if __name__ == "__main__":
				import doctest

				doctest.testmod()