mindspore.ops.Pow
- class mindspore.ops.Pow[source]
Calculates the y power of each element in x.
Refer to
mindspore.ops.pow()
for more details.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32) >>> y = 3.0 >>> pow = ops.Pow() >>> output = pow(x, y) >>> print(output) [ 1. 8. 64.] >>> >>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32) >>> y = Tensor(np.array([2.0, 4.0, 3.0]), mindspore.float32) >>> pow = ops.Pow() >>> output = pow(x, y) >>> print(output) [ 1. 16. 64.]