Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.resize

Contents

jax.numpy.resize#

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

Return a new array with specified shape.

JAX implementation ofnumpy.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 ofa are repeated inthe resized array, if the resized array is larger than the original array.

Return type:

Array

See also

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)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp