Computes the power of one tf.Tensor to another. Supports broadcasting.
tf.Tensor
Given a tf.Tensor x and a tf.Tensor y, this operation computes x^y for corresponding elements in x and y. The result's dtype will be the upcasted type of the base and exp dtypes.
base
exp
const a = tf.tensor([[2, 3], [4, 5]])const b = tf.tensor([[1, 2], [3, 0]]).toInt();a.pow(b).print(); // or tf.pow(a, b) Copy
const a = tf.tensor([[2, 3], [4, 5]])const b = tf.tensor([[1, 2], [3, 0]]).toInt();a.pow(b).print(); // or tf.pow(a, b)
const a = tf.tensor([[1, 2], [3, 4]])const b = tf.tensor(2).toInt();a.pow(b).print(); // or tf.pow(a, b) Copy
const a = tf.tensor([[1, 2], [3, 4]])const b = tf.tensor(2).toInt();a.pow(b).print(); // or tf.pow(a, b)
We also expose powStrict which has the same signature as this op and asserts that base and exp are the same shape (does not broadcast).
powStrict
The base tf.Tensor to pow element-wise.
The exponent tf.Tensor to pow element-wise.
Generated using TypeDoc
Computes the power of one
tf.Tensor
to another. Supports broadcasting.Given a
tf.Tensor
x and atf.Tensor
y, this operation computes x^y for corresponding elements in x and y. The result's dtype will be the upcasted type of thebase
andexp
dtypes.We also expose
powStrict
which has the same signature as this op and asserts thatbase
andexp
are the same shape (does not broadcast).