ityonemo / ez

zig linear algebra bindings for nx
34 stars 0 forks source link

complete all of the callback implementations for Nx.Backend #4

Open ityonemo opened 3 years ago

ityonemo commented 3 years ago
fire commented 3 years ago

Can you pick one and write how to complete one of them?

ityonemo commented 3 years ago

the starter ones are the binary tensor ops, the implementation lives here:

https://github.com/ityonemo/ez/blob/af2dd139d953f42d0f0a3bd4695907ad7bc69db2/lib/ez/zig_slice_backend.ex#L31-L64

tests are here: https://github.com/ityonemo/ez/blob/af2dd139d953f42d0f0a3bd4695907ad7bc69db2/test/ez_test.exs#L15-L61

most of the other tensor ops should be straightforward, but will need a different harness (since they emit a different type, e.g. the boolean ones).

Not sure if reduce or map are possible since those require calling out to elixir or an nx-rewritten ast sort of a thing, but I think it's ultimately doable

ityonemo commented 3 years ago

related: https://github.com/ityonemo/ez/issues/6