mindspore.ops.positive

mindspore.ops.positive(input)[source]

Return self Tensor.

Parameters

input (Tensor) – Input Tensor.

Returns

Tensor, self input.

Raises

TypeError – If input is not a Tensor.

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]), mstype.float32)
>>> print(ops.positive(x))
[ -5.    1.5   3.  100. ]