Skip to main content

split

Function split 

Source
pub fn split<T: Scalar, B: ComputeBackend + Default>(
    x: &Tensor<T, B>,
    chunk_size: usize,
    dim: usize,
) -> Result<Vec<Tensor<T, B>>, B::Error>
Expand description

Split x into chunks of size chunk_size along dim.

The last chunk may be smaller if x.shape()[dim] is not divisible.

ยงPanics

  • chunk_size is zero.
  • dim is out of range.