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]]
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