API

MLX.MLXArray — Type
MLXArray{T, N} <: AbstractArray{T, N}
MLXArray(array::AbstractArray)

An N-dimensional array of element type T, which can be used like an Array, but where operations are computed lazily by MLX, i.e. when their results are needed, or by MLX.evaluate.

MLXArray(array) copies array.

source
MLX.MLXNumber — Type
MLXNumber{T} <: Number

A scalar held by MLX as a 0-dimensional array, which can be used like a T, but where operations are computed lazily by MLX, as for an MLXArray.

Comparisons and conversions to other Number types evaluate it.

source
MLX.evaluate — Function
MLX.evaluate(arrays...)

Evaluates the given MLXArrays and MLXNumbers, which are otherwise only evaluated when their values are needed, e.g. when indexing them.

Evaluating them together lets MLX compute the operations they share once.

source