tensor.pow
#tensor.pow
Pow takes input data (Tensor) and exponent Tensor, and produces one output data (Tensor) where the function f(x) = x^exponent, is applied to the data tensor elementwise. The input tensors must have either:
Exactly the same shape
The same number of dimensions and the length of each dimension is either a common length or 1.
Args
self
(@Tensor<T>
) - The first tensor, base of the exponent.other
(@Tensor<T>
) - The second tensor, power of the exponent.
Panics
Panics if the shapes are not equal or broadcastable
Returns
A new Tensor<T>
with the same shape as the broadcasted inputs.
Examples
Case 1: Compare tensors with same shape
Case 2: Compare tensors with different shapes
Last updated