github.com/pytorch/pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Open this visualization on its own page →

Contributors

2312

Lines of Code

161,381

From

2012-01-25

To

2020-12-24

About pytorch/pytorch

PyTorch is a Python library for tensor computation and deep learning that provides two core capabilities: GPU-accelerated tensor operations similar to NumPy, and automatic differentiation through a tape-based autograd system. The library is designed to be deeply integrated with Python rather than a wrapper around a monolithic C++ framework, allowing users to write neural network layers and extensions naturally using Python and compatible libraries like NumPy, SciPy, and Cython.

The framework uses reverse-mode automatic differentiation to enable dynamic neural networks where computation graphs are built on the fly, allowing arbitrary changes to network behavior without rebuilding the entire structure. This design contrasts with static graph frameworks and emphasizes imperative, eager execution where code runs immediately when called, making debugging intuitive and stack traces clear.

PyTorch consists of several integrated components including the torch tensor library, torch.autograd for differentiation, torch.nn for neural networks, torch.jit for compilation and serialization, torch.multiprocessing for efficient data sharing across processes, and various utility functions. The project supports GPU acceleration through NVIDIA CUDA and cuDNN, AMD ROCm, Intel GPU backends, and CPU-only execution. Installation is available through binary packages or from source, with comprehensive build support for Linux, macOS, and Windows. The library is designed to be both fast and memory-efficient, integrating acceleration libraries like Intel MKL and NVIDIA technologies while maintaining minimal framework overhead.

Share this video