Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.hsplit

Contents

jax.numpy.hsplit#

jax.numpy.hsplit(ary,indices_or_sections)[source]#

Split an array into sub-arrays horizontally.

JAX implementation ofnumpy.hsplit().

Refer to the documentation ofjax.numpy.split() for details.hsplit isequivalent tosplit withaxis=1, oraxis=0 for one-dimensional arrays.

Examples

1D array:

>>>x=jnp.array([1,2,3,4,5,6])>>>x1,x2=jnp.hsplit(x,2)>>>print(x1,x2)[1 2 3] [4 5 6]

2D array:

>>>x=jnp.array([[1,2,3,4],...[5,6,7,8]])>>>x1,x2=jnp.hsplit(x,2)>>>print(x1)[[1 2] [5 6]]>>>print(x2)[[3 4] [7 8]]

See also

Parameters:
  • ary (ArrayLike)

  • indices_or_sections (int |Sequence[int]|ArrayLike)

Return type:

list[Array]

Contents

[8]ページ先頭

©2009-2025 Movatter.jp