Binary element-wise exponentiation of two tensor expressions.
Used to build a lazily evaluated Binary<Exponentiation, Base, Exponent>
expression. The result shape is determined via broadcasting rules, and the result type is chosen according to type promotion rules between the base and exponent.
Computation is deferred until forward()
is called or the expression is assigned to a Tensor
, meaning it can be composed into larger expression graphs without incurring immediate cost.
Example: Exponentiation
A[0, 0] = 2; A[0, 1] = 3;
A[1, 0] = 4; A[1, 1] = 5;
B[0, 0] = 3; B[0, 1] = 2;
B[1, 0] = 1; B[1, 1] = 0;
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.