mlx.core.to_fp8

Contents

mlx.core.to_fp8#

to_fp8(x: array, *, stream: None | Stream | Device = None) array#

Convert the array to fp8 (e4m3) from another floating-point type.

Parameters:

x (array) – The input array.

Returns:

The array converted to fp8 with type uint8.

Return type:

array