mlx
mlx copied to clipboard
Support initializing array from list of arrays
Running the snippet
import mlx.core as mx
a = mx.array([1.])
b = mx.array([2.])
mx.array([a,b])
produces error
----> [4] mx.array([a,b])
ValueError: Invalid type in array initialization<class 'mlx.core.array'>.
This works with numpy, so seems like a bug in mlx.
This isn't so much a bug as a feature request. MLX is still missing a lot of features that NumPy has.
For now you can use mx.concatenate or mx.stack. Will mark this as an feature request.
Got it, thanks! Will look into trying to implement it; seems like it might be straightforward.
I'm enjoying mlx so far!
Adding on here, can this feature support initializing from a list that contains numpy arrays?
a = mx.array( [np.array(1), np.array(1)])
This was closed in #325