rsokl / MyGrad

Drop-in autodiff for NumPy.
https://rsokl.github.io/MyGrad/
MIT License
195 stars 21 forks source link

Operation refactoring #351

Closed rsokl closed 3 years ago

rsokl commented 3 years ago

Implements an ergonomic and intuitive hierarchy of Operation subclasses. Among these is the Ufunc base class, which permits MyGrad's operations to easily match the interface of numpy's many ufuncs.

Ultimately, this PR will will enable MyGrad to leverage the interfaces __array_ufunc__ and __array_function__. Additionally, it makes it much easier for MyGrad to support specifying out, where, and dtype on a large majority of its operations.