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:
Notes
For unsigned integer inputs, this function returns
2 ** nbits - x
, wherenbits
is the number of bits in the integer representation.