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. | |
static txeo::Tensor< T > | increase_dimension (const txeo::Tensor< T > &tensor, size_t axis, T value) |
Increments the dimension of the tensor at the specified axis. | |
static txeo::Tensor< T > & | increase_dimension_by (txeo::Tensor< T > &tensor, size_t axis, T value) |
Increments the dimension of the tensor at the specified axis (in-place) | |
static txeo::Matrix< T > | sub_matrix_cols (const txeo::Matrix< T > &matrix, const std::vector< size_t > &cols) |
Creates a submatrix containing specified columns. | |
static txeo::Matrix< T > | sub_matrix_cols_exclude (const txeo::Matrix< T > &matrix, const std::vector< size_t > &cols) |
Creates a submatrix excluding the specified columns. | |
static txeo::Matrix< T > | sub_matrix_rows (const txeo::Matrix< T > &matrix, const std::vector< size_t > &rows) |
Creates a submatrix containing specified rows. | |
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 24 of file TensorPart.h.
|
delete |
|
delete |
txeo::TensorPart< T >::~TensorPart | ( | ) |
|
static |
Increments the dimension of the tensor at the specified axis.
tensor | Tensor which elements will generate the modified tensor |
axis | Position where new dimension will be inserted |
value | Value to fill the new dimension elements with |
Example Usage:
|
static |
Increments the dimension of the tensor at the specified axis (in-place)
tensor | Tensor which shape will be altered |
axis | Position where new dimension will be inserted |
value | Value to fill the new dimension elements with |
Example Usage:
|
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 |
Creates a submatrix containing specified columns.
matrix | Source matrix |
cols | Vector of column indices to select |
TensorPartError |
Example Usage:
|
static |
Creates a submatrix excluding the specified columns.
matrix | Source matrix |
cols | Vector of column indices to exclude |
TensorPartError |
Example Usage:
|
static |
Creates a submatrix containing specified rows.
matrix | Source matrix |
rows | Vector of row indices to select |
TensorPartError |
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: