Torch

Torch is an open-source machine learning framework originally built using the Lua programming language. First released in 2002, it became especially popular in research labs during the early-to-mid 2010s, and its core design directly inspired the creation of PyTorch.

Key Characteristics

  • Used Lua as its primary scripting language, chosen for its speed and simplicity
  • Provided a flexible N-dimensional array (tensor) library, similar in spirit to NumPy
  • Supported GPU acceleration for fast training of neural networks
  • Used at major research labs including Facebook AI Research, Google DeepMind, and NYU

The Transition to PyTorch

While Torch was powerful, Lua's relatively small user base compared to Python limited its wider adoption. In 2016, Facebook AI Research released PyTorch - a Python-based reimagining of Torch's design philosophy, particularly its dynamic, "define-by-run" computation graph, which quickly overtook the original Torch in popularity.

Torch's Legacy

Many of the ideas that make PyTorch popular today - flexible tensor operations, dynamic computation graphs, and an emphasis on ease of experimentation - trace their roots directly back to the original Torch library.

If you've used PyTorch, you've already experienced Torch's design philosophy firsthand - PyTorch was explicitly built to bring Torch's flexibility to the much larger Python ecosystem.

Coming Up Next

The final library in this tour is one built with a very specific goal in mind - raw speed for image-based deep learning - Caffe.

Ready to Master Data Science?

Join Uncodemy's Data Science Course and build real, job-ready skills with expert mentors.

Explore Course