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.resize.html below:

jax.numpy.resize — JAX documentation

jax.numpy.resize#
jax.numpy.resize(a, new_shape)[source]#

Return a new array with specified shape.

JAX implementation of numpy.resize().

Parameters:
  • a (ArrayLike) – input array or scalar.

  • new_shape (Shape) – int or tuple of ints. Specifies the shape of the resized array.

Returns:

A resized array with specified shape. The elements of a are repeated in the resized array, if the resized array is larger than the original array.

Return type:

Array

Examples

>>> x = jnp.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
>>> jnp.resize(x, (3, 3))
Array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]], dtype=int32)
>>> jnp.resize(x, (3, 4))
Array([[1, 2, 3, 4],
       [5, 6, 7, 8],
       [9, 1, 2, 3]], dtype=int32)
>>> jnp.resize(4, (3, 2))
Array([[4, 4],
       [4, 4],
       [4, 4]], dtype=int32, weak_type=True)

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.4