"from scratch" in this context does not make any sense - Pytorch is already implemented "from scratch" using Python, C++, and CUDA. Implementing Pytorch using Numpy is the opposite of "from scratch".
They must be doing something else with numpy as Python has a generic API, that allows direct access to data of numpy array-like structures: Buffer Protocol https://docs.python.org/3/c-api/buffer.html
Buffer protocol means PyTorch can have a torch.tensor method, that can create a tensor of anything implementing this protocol (which NumPy arrays do), and likewise numpy.array can be constructed out of PyTorch array because PyTorch Tensor implements this protocol. E.g. they don't need to know about each other (so no dependency), only about the protocol.
It's totally fine if you want to implement a DL library using Numpy. Just don't call it "from scratch". Especially if you say "in pure Python". Numpy is just as "pure Python" as Pytorch, so this does not make much sense.
21 comments
[ 2.7 ms ] story [ 57.8 ms ] threadJulia: https://juliadiff.org/ChainRulesCore.jl/stable/FAQ.html#Wher...? (bottom)
OCaml: https://ocaml.xyz/book/
The only language that you might actually use is Python.
Does pytorch already require numpy?
If that's what you want, then there are:
- Data Science from Scratch
- Deep Learning from Scratch