Tannic
A C++ Tensor Library
|
Expression template for a unary tensor aritmetic operation. More...
#include <operations.hpp>
Public Member Functions | |
constexpr | Unary (Operation operation, Trait< Operand >::Reference operand) |
Constructs a Unary expression. | |
constexpr type | dtype () const |
Returns the data type of the result. | |
constexpr Shape const & | shape () const |
Returns the shape of the result. | |
constexpr Strides const & | strides () const |
Returns the strides of the result. | |
std::ptrdiff_t | offset () const |
Returns the offset of the expression. | |
Tensor | forward () const |
Evaluates the unary expression and returns a Tensor. | |
Public Attributes | |
Operation | operation |
Trait< Operand >::Reference | operand |
Expression template for a unary tensor aritmetic operation.
Represents a lazily evaluated unary operation applied to a single tensor-like operand. This template enables deferred execution and composability at compile time.
|
inlineconstexpr |
|
inlineconstexpr |
Returns the data type of the result.
Since the unary operation acts element-wise and does not change type, this returns the same type as the operand.
Tensor tannic::operation::Unary< Operation, Operand >::forward |
|
inline |
Returns the offset of the expression.
|
inlineconstexpr |
Returns the shape of the result.
The output of a unary operation has the exact same shape as the operand.
|
inlineconstexpr |
Returns the strides of the result.
The output tensor has the same memory layout as the operand, so the strides are forwarded directly.
Trait<Operand>::Reference tannic::operation::Unary< Operation, Operand >::operand |
Operation tannic::operation::Unary< Operation, Operand >::operation |