mindspore.ops.Inv

class mindspore.ops.Inv[source]

Computes Reciprocal of input tensor element-wise.

Refer to mindspore.ops.inv() for more details.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from mindspore.ops.operations.math_ops import Inv
>>> inv = Inv()
>>> x = Tensor(np.array([0.25, 0.4, 0.31, 0.52]), mindspore.float32)
>>> output = inv(x)
>>> print(output)
[4.        2.5       3.2258065 1.923077 ]