"""simple docstring"""


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


UpperCAmelCase__			=    logging.get_logger(__name__)

UpperCAmelCase__			=    {
    """facebook/s2t-small-librispeech-asr""": (
        """https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json"""
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}


class 							a					(		lowerCAmelCase_ ):
    _snake_case  :	Any  				=				'speech_to_text'
    _snake_case  :	int  				=				['past_key_values']
    _snake_case  :	int  				=				{'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}


    def __init__(       self						:	List[str] ,					__lowerCAmelCase						:	str=1_0000 ,					__lowerCAmelCase						:	Optional[Any]=12 ,					__lowerCAmelCase						:	List[str]=2048 ,					__lowerCAmelCase						:	Union[str, Any]=4 ,					__lowerCAmelCase						:	Dict=6 ,					__lowerCAmelCase						:	Union[str, Any]=2048 ,					__lowerCAmelCase						:	Optional[Any]=4 ,					__lowerCAmelCase						:	Union[str, Any]=0.0 ,					__lowerCAmelCase						:	int=0.0 ,					__lowerCAmelCase						:	Optional[int]=True ,					__lowerCAmelCase						:	int=True ,					__lowerCAmelCase						:	Tuple="relu" ,					__lowerCAmelCase						:	Optional[Any]=256 ,					__lowerCAmelCase						:	int=0.1 ,					__lowerCAmelCase						:	Union[str, Any]=0.0 ,					__lowerCAmelCase						:	List[str]=0.0 ,					__lowerCAmelCase						:	int=0.02 ,					__lowerCAmelCase						:	str=2 ,					__lowerCAmelCase						:	List[Any]=True ,					__lowerCAmelCase						:	Optional[Any]=1 ,					__lowerCAmelCase						:	Any=0 ,					__lowerCAmelCase						:	Optional[int]=2 ,					__lowerCAmelCase						:	Optional[Any]=6000 ,					__lowerCAmelCase						:	Tuple=1024 ,					__lowerCAmelCase						:	List[str]=2 ,					__lowerCAmelCase						:	Optional[Any]=(5, 5) ,					__lowerCAmelCase						:	List[Any]=1024 ,					__lowerCAmelCase						:	List[Any]=80 ,					__lowerCAmelCase						:	List[Any]=1 ,					**__lowerCAmelCase						:	List[str] ,					):
      _UpperCAmelCase    			=   vocab_size
      _UpperCAmelCase    			=   d_model
      _UpperCAmelCase    			=   encoder_ffn_dim
      _UpperCAmelCase    			=   encoder_layers
      _UpperCAmelCase    			=   encoder_attention_heads
      _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    			=   encoder_layerdrop
      _UpperCAmelCase    			=   decoder_layerdrop
      _UpperCAmelCase    			=   use_cache
      _UpperCAmelCase    			=   encoder_layers
      _UpperCAmelCase    			=   scale_embedding  # scale factor will be sqrt(d_model) if True
      _UpperCAmelCase    			=   max_source_positions
      _UpperCAmelCase    			=   max_target_positions
      _UpperCAmelCase    			=   num_conv_layers
      _UpperCAmelCase    			=   list(__lowerCAmelCase       )
      _UpperCAmelCase    			=   conv_channels
      _UpperCAmelCase    			=   input_feat_per_channel
      _UpperCAmelCase    			=   input_channels

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

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

"""simple docstring"""


from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray






def      __UpperCAmelCase       (      lowercase ,lowercase ,lowercase = False		):







  """simple docstring"""
  if radian_mode:
    return [magnitude * cos(lowercase		), magnitude * sin(lowercase		)]
  return [magnitude * cos(radians(lowercase		)		), magnitude * sin(radians(lowercase		)		)]






def      __UpperCAmelCase       (      lowercase ,lowercase ,lowercase = 10**-1		):







  """simple docstring"""
  _UpperCAmelCase    			=   cross(lowercase ,lowercase		)
  _UpperCAmelCase    			=   sum(lowercase		)
  return abs(lowercase		) < eps


if __name__ == "__main__":
    # Test to check if it works
    UpperCAmelCase__			=    array(
        [
            polar_force(718.4, 1_8_0 - 3_0),
            polar_force(879.54, 4_5),
            polar_force(1_0_0, -9_0),
        ]
    )

    UpperCAmelCase__			=    array([[0, 0], [0, 0], [0, 0]])

    assert in_static_equilibrium(forces, location)

    # Problem 1 in image_data/2D_problems.jpg
    UpperCAmelCase__			=    array(
        [
            polar_force(3_0 * 9.81, 1_5),
            polar_force(2_1_5, 1_8_0 - 4_5),
            polar_force(2_6_4, 9_0 - 3_0),
        ]
    )

    UpperCAmelCase__			=    array([[0, 0], [0, 0], [0, 0]])

    assert in_static_equilibrium(forces, location)

    # Problem in image_data/2D_problems_1.jpg
    UpperCAmelCase__			=    array([[0, -2_0_0_0], [0, -1_2_0_0], [0, 1_5_6_0_0], [0, -1_2_4_0_0]])

    UpperCAmelCase__			=    array([[0, 0], [6, 0], [1_0, 0], [1_2, 0]])

    assert in_static_equilibrium(forces, location)

    import doctest

    doctest.testmod()
