Expand description
Tensor utility functions for converting between vectors and tensors.
This module provides functions to convert between Rust vectors and multi-dimensional tensors (1D, 2D, 3D, and 4D). It also includes utility functions for tensor operations like slicing and stacking.
Functionsยง
- stack_
tensor2d - Stacks a slice of 2D tensors into a single 3D tensor.
- stack_
tensor3d - Stacks a slice of 3D tensors into a single 4D tensor.
- tensor1d_
to_ vec - Converts a 1D tensor into a 1D vector of f32 values.
- tensor2d_
to_ vec - Converts a 2D tensor into a 2D vector of f32 values.
- tensor3d_
slice - Extracts a 2D slice from a 3D tensor at the specified index.
- tensor3d_
to_ vec - Converts a 3D tensor into a 3D vector of f32 values.
- tensor4d_
slice - Extracts a 3D slice from a 4D tensor at the specified index.
- tensor4d_
to_ vec - Converts a 4D tensor into a 4D vector of f32 values.
- vec_
to_ tensor1d - Converts a 1D vector of f32 values into a 1D tensor with the specified shape.
- vec_
to_ tensor2d - Converts a 2D vector of f32 values into a 2D tensor.
- vec_
to_ tensor3d - Converts a 3D vector of f32 values into a 3D tensor.
- vec_
to_ tensor4d - Converts a 4D vector of f32 values into a 4D tensor.