jax.numpy.array_split#
- jax.numpy.array_split(ary, indices_or_sections, axis=0)[source]#
将数组拆分为子数组。
JAX 中
numpy.array_split()
的实现。有关详细信息,请参阅
jax.numpy.split()
的文档;array_split
等同于split
,但允许整数indices_or_sections
,该整数不能均匀地分割分割轴。示例
>>> x = jnp.array([1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> chunks = jnp.array_split(x, 4) >>> print(*chunks) [1 2 3] [4 5] [6 7] [8 9]
另请参阅
jax.numpy.split()
:沿任何轴分割数组。jax.numpy.vsplit()
:垂直分割,即沿 axis=0jax.numpy.hsplit()
:水平分割,即沿 axis=1jax.numpy.dsplit()
:深度分割,即沿 axis=2