jax.lax.neg#

jax.lax.neg(x)[source]#

Elementwise negation: \(-x\).

This function lowers directly to the stablehlo.negate operation.

Parameters:

x (ArrayLike) – input array

Returns:

Array of same shape and dtype as x, containing the element-wise negative.

Return type:

Array

Notes

For unsigned integer inputs, this function returns 2 ** nbits - x, where nbits is the number of bits in the integer representation.