MLX is lazy. No actual computation happens until you explicitly or implicitly evaluate the graph. Here are some ways that can happen:
- Explicit call to
mx.eval
- Call
a.item()
on a scalar array - Convert an array to NumPy, i.e.
np.array(a)
- Print an array