pub fn chunk<B, K>(
tensor: <K as TensorKind<B>>::Primitive,
chunks: usize,
dim: usize,
) -> Vec<<K as TensorKind<B>>::Primitive>
Expand description
Split the tensor along the given dimension into chunks.
§Arguments
tensor
- The tensor.chunks
- The number of chunks to be producedtimes
- The dimension along which the tensor will be split.
§Returns
A vectors of tensors
§Remarks
This is a fallback solution that used only when the backend doesn’t have the corresponding implementation. Ideally, it is supposed to be implemented by the backend and the backend implementation will be resolved by static dispatch. It is not designed for direct usage by users, and not recommended to import or use this function directly.