Txeo v0.1
A Developer-Friendly TensorFlow C++ Wrapper
|
A utility class for partitioning tensors. More...
#include <TensorPart.h>
Public Member Functions | |
TensorPart (const TensorPart &)=delete | |
TensorPart (TensorPart &&)=delete | |
TensorPart & | operator= (const TensorPart &)=delete |
TensorPart & | operator= (TensorPart &&)=delete |
~TensorPart () | |
Static Public Member Functions | |
static std::vector< txeo::Tensor< T > > | unstack (const txeo::Tensor< T > &tensor, size_t axis) |
Unstacks a tensor along a specified axis into a list of tensors. | |
static txeo::Tensor< T > | slice (const txeo::Tensor< T > &tensor, size_t first_axis_begin, size_t first_axis_end) |
Returns a view of the tensor from a specified range of dimensions of the first axis. | |
A utility class for partitioning tensors.
This class provides static methods for operations such as unstacking tensors along a specified axis and slicing tensors along the first axis.
T | The data type of the tensor elements (e.g., int, double). |
Definition at line 19 of file TensorPart.h.
|
delete |
|
delete |
txeo::TensorPart< T >::~TensorPart | ( | ) |
|
delete |
|
delete |
|
static |
Returns a view of the tensor from a specified range of dimensions of the first axis.
This function creates a new tensor that views the content of the tensor according to the specified parameters. There is no element copying.
first_axis_begin | Initial index along the first axis (inclusive). |
first_axis_end | Final index along the first axis (exclusive). |
Example Usage:
|
static |
Unstacks a tensor along a specified axis into a list of tensors.
T | The data type of the tensor elements. |
tensor | The input tensor to unstack. |
axis | The axis along which to unstack the tensor. Must be a valid axis for the input tensor. |
txeo::TensorPartError |
Example Usage:
Output: