mindspore.Tensor.sqrt

Tensor.sqrt()[source]

Returns sqrt of a tensor element-wise.

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

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

Raises

TypeError – If output is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

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