Skip to main content

sign

Function sign 

Source
pub fn sign(a: &Array) -> Result<Array>
Expand description

Element-wise sign: -1, 0 or 1 in a’s dtype, as MLX’s sign ((a > 0) - (a < 0), so NaN gives 0). Unsigned integers and booleans give a != 0. Complex numbers are not supported.