mindspore.mint.sqrt

mindspore.mint.sqrt(input)[source]

Returns sqrt of a tensor element-wise.

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

input (Tensor) – The input tensor with a dtype of number.Number.

Returns

Tensor, has the same shape as the input.

Raises

TypeError – If input is not a Tensor.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> input = Tensor(np.array([1.0, 4.0, 9.0]), mindspore.float32)
>>> output = mint.sqrt(input)
>>> print(output)
[1. 2. 3.]