Implement diagonal operator (#562)

* Implement diagonal operator

This implements mx.diagonal in operator level, inspired by
@ManishAradwad.

* added `mx.diag` with tests

* corrected few things

* nits in bindings

* updates to diag

---------

Co-authored-by: ManishAradwad <[email protected]>
Co-authored-by: Awni Hannun <[email protected]>
This commit is contained in:
Jacket
2024-01-30 09:45:48 -08:00
committed by GitHub
co-authored by ManishAradwad Awni Hannun
parent 65d0b8df9f
commit 3f7aba8498
8 changed files with 309 additions and 4 deletions
+2
View File
@@ -35,6 +35,8 @@ Operations
cos
cosh
dequantize
diag
diagonal
divide
divmod
equal