ml-explore / mlx

MLX: An array framework for Apple silicon
https://ml-explore.github.io/mlx/
MIT License
16.23k stars 925 forks source link

[Feature] cross product #1244

Open petertsoi opened 1 month ago

petertsoi commented 1 month ago

It would be nice to have a mx.cross/mx.linalg.cross that works like np.cross/np.linalg.cross.

awni commented 1 month ago

I think we don't need a primitive for this since it's just a handful of ops. If it's too slow the naive way we can re-evaluate.

I would do it with a split -> adds + multiplies -> concat.