Binary element-wise addition of two tensor expressions.
Used to build a lazily evaluated Binary<Addition, Augend, Addend>
expression. Computation is deferred until forward()
is called or assigned to a Tensor
. Supports broadcasting and type promotion.
Example: Addition
A[0, 0] = 1; A[0, 1] = 2;
A[1, 0] = 3; A[1, 1] = 4;
B[0, 0] = 5; B[0, 1] = 6;
B[1, 0] = 7; B[1, 1] = 8;
auto C = A + B;
std::cout << C.forward();
A multidimensional, strided tensor data structure.
Definition: tensor.hpp:105
void initialize(Environment environment=Host{}) const
Allocates the memory buffer for the tensor.