jax.numpy.array_split#
- jax.numpy.array_split(ary, indices_or_sections, axis=0)[源代码][源代码]#
将一个数组分割成子数组。
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(): 垂直分割,即沿着轴=0jax.numpy.hsplit(): 水平分割,即沿 axis=1 分割jax.numpy.dsplit():按深度分割,即沿 axis=2 分割