Skip to main content

NDArray::sign

public static function sign(NDArray|array|float|int $array): NDArray|float|int;

Computes the element-wise sign of an array, returning a new array with the sign of each element (1 for positive, -1 for negative, 0 for zero).


Notes

tip

GPU SUPPORTED

This operation is supported by GPU (VRAM) and contains a custom CUDA kernel.