dlgrad (Deep Learning autograd): A Lightweight Autograd Engine for Deep Learning
Inspired by Andrej Karpathy's micrograd and George Hotz's tinygrad, dlgrad is my personal exploration into building an Autograd engine from scratch. Its lightweight in design and has PyTorch like API.
- CPU and GPU Support: The library currently supports both CPU and GPU (Metal) backends.
You can read my blog to learn more about how dlgrad operates.
from dlgrad.tensor import Tensor
# Create tensors filled with random numbers from a uniform distribution
a = Tensor.rand(10, 10)
b = Tensor.rand(10, 10)
# Since the tensors are c buffers, use numpy to print
print(a.numpy())
print(b.numpy())
c = Tensor.add(a, b)
print(c.numpy())