Txeo v0.1
A Developer-Friendly TensorFlow C++ Wrapper
|
A utility class for common math functions on tensors. More...
#include <TensorFunc.h>
Public Member Functions | |
TensorFunc (const TensorFunc &)=delete | |
TensorFunc (TensorFunc &&)=delete | |
TensorFunc & | operator= (const TensorFunc &)=default |
TensorFunc & | operator= (TensorFunc &&)=delete |
~TensorFunc ()=default | |
Static Public Member Functions | |
static txeo::Tensor< T > | power_elem (const txeo::Tensor< T > &tensor, const T &exponent) |
Returns the element-wise potentiation of a tensor. | |
static txeo::Tensor< T > | power_elem_by (txeo::Tensor< T > &tensor, const T &exponent) |
Performs element-wise potentiation of the tensor (in-place) | |
static txeo::Tensor< T > | square (const txeo::Tensor< T > &tensor) |
Computes the element-wise square of a tensor. | |
static txeo::Tensor< T > & | square_by (txeo::Tensor< T > &tensor) |
Computes the element-wise square of a tensor in-place. | |
static txeo::Tensor< T > | sqrt (const txeo::Tensor< T > &tensor) |
Computes the element-wise square root of a tensor. | |
static txeo::Tensor< T > & | sqrt_by (txeo::Tensor< T > &tensor) |
Computes the element-wise square root of a tensor in-place. | |
static txeo::Tensor< T > | abs (const txeo::Tensor< T > &tensor) |
Computes the element-wise absolute value of a tensor. | |
static txeo::Tensor< T > & | abs_by (txeo::Tensor< T > &tensor) |
Computes the element-wise absolute value of a tensor in-place. | |
static txeo::Tensor< T > | permute (const txeo::Tensor< T > &tensor, const std::vector< size_t > &axes) |
Permutes the axes of a tensor. | |
static txeo::Tensor< T > & | permute_by (txeo::Tensor< T > &tensor, const std::vector< size_t > &axes) |
Permutes the axes of a tensor in-place. | |
static txeo::Matrix< T > | transpose (const txeo::Matrix< T > &matrix) |
Transposes a matrix. | |
static txeo::Matrix< T > & | transpose_by (txeo::Matrix< T > &matrix) |
Transposes a matrix in-place. | |
A utility class for common math functions on tensors.
This class provides static methods for common tensor functions, such as square.
T | The data type of the tensor elements (e.g., int, double). |
Definition at line 23 of file TensorFunc.h.
|
delete |
|
delete |
|
default |
|
static |
Computes the element-wise absolute value of a tensor.
tensor | The input tensor to be modified. |
Example Usage:
|
static |
Computes the element-wise absolute value of a tensor in-place.
tensor | The input tensor to be modified. |
Example Usage:
|
default |
|
delete |
|
static |
Permutes the axes of a tensor.
tensor | The input tensor. |
axes | The new order of the tensor axes. Must be a valid permutation of the tensor's dimensions. |
std::invalid_argument | If the axes are invalid (e.g., size mismatch or out of range). |
Example Usage:
|
static |
Permutes the axes of a tensor in-place.
tensor | The input tensor to be modified. |
axes | The new order of axes. Must be a valid permutation of the tensor's dimensions. |
std::invalid_argument | If the axes are invalid (e.g., size mismatch or out of range). |
Example Usage:
|
static |
Returns the element-wise potentiation of a tensor.
tensor | Tensor to be powered |
exponent | Exponent of the potentiation |
Example Usage:
|
static |
Performs element-wise potentiation of the tensor (in-place)
tensor | Tensor to be modified |
exponent | Exponent of the potentiation |
Example Usage:
|
static |
Computes the element-wise square root of a tensor.
tensor | The input tensor. |
Example Usage:
|
static |
Computes the element-wise square root of a tensor in-place.
tensor | The input tensor to be modified. |
Example Usage:
|
static |
Computes the element-wise square of a tensor.
tensor | The input tensor. |
Example Usage:
|
static |
Computes the element-wise square of a tensor in-place.
tensor | The input tensor to be modified. |
Example Usage:
|
static |
Transposes a matrix.
matrix | The input matrix. |
Example Usage:
|
static |
Transposes a matrix in-place.
matrix | The input matrix to be modified. |
Example Usage: