Skip to content

uint8

builtin · libnexusinterp/nexus-value/ov-proprietary.cc

: y = uint8 (x)

Return x recast as an unsigned 8-bit integer array, with range 0 to 255.

Non-integer values are rounded to the nearest integer, with halves rounded away from zero. Values outside the representable range saturate rather than wrapping, so negatives become 0 and values above the maximum become 255. The shape of x is preserved and exactly one argument is required.