mindspore.ops.positive

mindspore.ops.positive(x)[source]

Return self Tensor.

Parameters

x (Tensor) – Input Tensor.

Returns

Tensor, self input.

Raises

TypeError – If the dtype of self Tensor is bool type.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> from mindspore import dtype as mstype
>>> x = Tensor(np.array([-5.0, 1.5, 3.0, 100.0]), ms.float32)
>>> print(ops.positive(x))
[ -5.    1.5   3.  100. ]