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

jax.numpy.hsplit — JAX documentation

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

Split an array into sub-arrays horizontally.

JAX implementation of numpy.hsplit().

Refer to the documentation of jax.numpy.split() for details. hsplit is equivalent to split with axis=1, or axis=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]]
Parameters:
  • ary (ArrayLike)

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

Return type:

list[Array]


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