It has nothing to do with Torch’s Lua modules. Torch7 itself consists of a Lua wrapper on top of a C backend, and PyTorch wraps the same C backend (which is still hosted in Torch7’s Github repository), along with a new C++ autograd engine, in a Python frontend.