burn::tensor

Function split_with_sizes

pub fn split_with_sizes<B, K>(
    tensor: <K as TensorKind<B>>::Primitive,
    split_sizes: Vec<usize>,
    dim: usize,
) -> Vec<<K as TensorKind<B>>::Primitive>
where B: Backend, K: TensorKind<B> + BasicOps<B>,
Expand description

Splits the tensor along the given dimension into chunks with sizes in dim according to split_sizes.

§Arguments

  • tensor - The tensor.
  • split_sizes - Vector of sizes for each chunk.
  • dim - The dimension along which to split the tensor.

§Returns

A vector of tensors.

§Remarks

Fallback solution for backends with no equivalent functionality.