A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.polyadd.html below:

jax.numpy.polyadd — JAX documentation

jax.numpy.polyadd#
jax.numpy.polyadd(a1, a2)[source]#

Returns the sum of the two polynomials.

JAX implementation of numpy.polyadd().

Parameters:
  • a1 (ArrayLike) – Array of polynomial coefficients.

  • a2 (ArrayLike) – Array of polynomial coefficients.

Returns:

An array containing the coefficients of the sum of input polynomials.

Return type:

Array

Examples

>>> x1 = jnp.array([2, 3])
>>> x2 = jnp.array([5, 4, 1])
>>> jnp.polyadd(x1, x2)
Array([5, 6, 4], dtype=int32)
>>> x3 = jnp.array([[2, 3, 1]])
>>> x4 = jnp.array([[5, 7, 3],
...                 [8, 2, 6]])
>>> jnp.polyadd(x3, x4)
Array([[ 5,  7,  3],
       [10,  5,  7]], dtype=int32)
>>> x5 = jnp.array([1, 3, 5])
>>> x6 = jnp.array([[5, 7, 9],
...                 [8, 6, 4]])
>>> jnp.polyadd(x5, x6)  
Traceback (most recent call last):
...
ValueError: Cannot broadcast to shape with fewer dimensions: arr_shape=(2, 3) shape=(2,)
>>> x7 = jnp.array([2])
>>> jnp.polyadd(x6, x7)
Array([[ 5,  7,  9],
       [10,  8,  6]], dtype=int32)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3