Torch is a framework for scientific computing in LUA. However, it has mostly been used for deep learning research as it provides efficient and comfortable C/CUDA implementations of a wide range of (convolutional and/or recurrent) neural network components. In this article, I want to provide a code template allowing to easily extend torch.nn
by custom modules implemented in C and/or CUDA without knowledge of Torch’s core.