mxnet.np.positive

positive(x, out=None, **kwargs)

Computes the numerical positive of each element x_i (i.e.,`y_i = +x_i`) of the input array x .

Parameters

x (ndarray or scalar) – Input array.

Returns

y – Returned array or scalar: y = +x. This is a scalar if x is a scalar.

Return type

ndarray or scalar

Notes

Equivalent to x.copy(), but only defined for types that support arithmetic.

Examples

>>> x1 = np.array(([1., -1.]))
>>> np.positive(x1)
array([ 1., -1.])
>>> +x1
array([ 1., -1.])