jax.numpy.dsplit#
- jax.numpy.dsplit(ary, indices_or_sections)[源代码][源代码]#
将数组深度分割为子数组。
JAX 实现的
numpy.dsplit()。详情请参阅
jax.numpy.split()的文档。dsplit等同于split并设置axis=2。示例
>>> x = jnp.arange(12).reshape(3, 1, 4) >>> print(x) [[[ 0 1 2 3]] [[ 4 5 6 7]] [[ 8 9 10 11]]] >>> x1, x2 = jnp.dsplit(x, 2) >>> print(x1) [[[0 1]] [[4 5]] [[8 9]]] >>> print(x2) [[[ 2 3]] [[ 6 7]] [[10 11]]]
参见
jax.numpy.split(): 沿任意轴分割数组。jax.numpy.vsplit(): 垂直分割,即沿着轴=0jax.numpy.hsplit(): 水平分割,即沿 axis=1 分割jax.numpy.array_split(): 类似于split,但允许indices_or_sections为不能均匀划分数组大小的整数。