mindspore.ops.sqrt

mindspore.ops.sqrt(x)[source]

Returns sqrt of a tensor element-wise.

\[out_{i} = \sqrt{x_{i}}\]
Parameters

x (Tensor) – The input tensor with a dtype of number.Number, its rank must be in [0, 7] inclusive.

Returns

Tensor, has the same shape and dtype as the x.

Raises

TypeError – If x is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([1.0, 4.0, 9.0]), mindspore.float32)
>>> output = ops.sqrt(x)
>>> print(output)
[1. 2. 3.]