Skip to content
fn

to_mlx_dtype

→mlx::core::Dtype
int to_mlx_dtype(Dtype dt)

Map a Lucid Dtype to the matching mlx::core::Dtype.

See Also

from_mlx_dtype — inverse direction.

Parameters

dtDtype
Lucid element type.

Returns

mlx::core::Dtype

The corresponding MLX dtype enumerator.

Raises

not_implemented
If dt == Dtype::F64 — Apple's Metal stack has no native 64-bit floating-point path, so float64 tensors cannot live on the GPU. Callers must downcast to float32 first or keep the tensor on the CPU.