jax.numpy.negative

jax.numpy.negative(x)

Numerical negative, element-wise.

LAX-backend implementation of negative(). Original docstring below.

negative(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])

Parameters

x (array_like 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

Examples

>>> np.negative([1.,-1.])
array([-1.,  1.])