Binary element-wise subtraction of two tensor expressions.
Used to build a lazily evaluated Binary<Subtraction, Subtrahend, Minuend>
expression. Computation is deferred until forward()
is called or assigned to a Tensor
. Supports broadcasting and type promotion.
Example: Subtraction
A[0, 0] = 5; A[0, 1] = 7;
A[1, 0] = 9; A[1, 1] = 11;
B[0, 0] = 1; B[0, 1] = 2;
B[1, 0] = 3; B[1, 1] = 4;
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.