rsokl / MyGrad

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

Make tensor.backward() support broadcasting and type-casting #343

Closed rsokl closed 3 years ago

rsokl commented 3 years ago

tensor.backward(grad) now supports grad that can be broadcast into tensor. The resulting tensor.grad will be cast to the correction (floating) dtype.