Differences between Torch and PyTorch deep learning libraries

In this article, we have explored some of the differences between two popular frameworks namely Torch and PyTorch. As the name suggest, both frameworks have a common origin but have taken two different paths in a quest to improve Deep Learning for all.

Common Origin

Initially, Torch was developed and later, PyTorch was developed as a Python implementation of Torch. Both frameworks have been developed by Facebook. Both are open source.

Current Status

The development of Torch has been stopped while PyTorch is in active development.

The internal libraries used by Torch will be continued to be supported and developed as it is used by PyTorch as a wrapper.

Source code and Usage

Torch was written in Lua while PyTorch was written in Python.

PyTorch and Torch use the same C libraries that contain all the performance such as:

TH

THC

THNN

THCUNN

These libraries will continue to be shared.

There are some architectural improvements in PyTorch as well.

In Torch, there were containers. In Pytorch there are no containers hence, we need to construct our model as a subclass of Module and redefine the forward and backward step as a method.