power(x1, x2, dtype=None)¶
First array elements raised to powers from second array, element-wise.
Raises each base in x1 to the positionally-corresponding power in x2.
Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported. On GPU, the supported dtypes are np.float16, and np.float32.
Tensor or scalar, the bases in x1 raised to the exponents in x2. This is a scalar if both x1 and x2 are scalars.
- Supported Platforms:
>>> import mindspore.numpy as np >>> x1 = np.full((3, 2), [1, 2]).astype('float32') >>> x2 = np.full((3, 2), [3, 4]).astype('float32') >>> output = np.power(x1, x2) >>> print(output) [[ 1. 16.] [ 1. 16.] [ 1. 16.]]