mindspore.ops.Sqrt

class mindspore.ops.Sqrt(*args, **kwargs)[source]

Returns square root of a tensor element-wise.

Inputs:
  • input_x (Tensor) - The input tensor whose dtype is number.

Outputs:

Tensor, has the same shape as the input_x.

Raises

TypeError – If input_x is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

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

Infer the value of input for Sqrt.