PyTorch

PyTorch

Open-source Python and C++ deep learning framework featuring GPU-accelerated tensors, dynamic autograd, and torch.compile optimization.

★ 106.0K

Build, debug, and train neural networks at GPU speed with dynamic Python execution

Early deep learning frameworks forced researchers to compile static computation graphs upfront, making standard Python breakpoints and conditional loops painful to debug. PyTorch won over both academic research and industrial AI training by pairing eager, Python-first tensor execution with a fast C++ and CUDA tape-based autograd engine. Backed by 106.0K GitHub stars and 30,700 forks under the BSD-3-Clause license and governed by the Linux Foundation, it underpins modern LLMs, diffusion models, and robotics stacks.

Core pillars of modern PyTorch

  • Dynamic eager mode lets you inspect tensor shapes, set standard `pdb` breakpoints, and step through neural network layers just like normal NumPy code.
  • `torch.compile` traces Python modules and generates fused Triton and C++ GPU kernels automatically, delivering major speedups with a single decorator.
  • Distributed training primitives (`DDP`, `FSDP2`, `DTensor`) coordinate billion-parameter model sharding across NVIDIA CUDA, AMD ROCm, Intel XPU, and Apple MPS hardware.
  • Seamless ecosystem compatibility links directly to Hugging Face Transformers, Ray Train, Unsloth, and ONNX/ExecuTorch mobile edge runtimes.

Environment hygiene tip

Matching PyTorch wheel builds to your host CUDA or ROCm driver version is the most common setup snag, so pin the exact `–index-url` in `uv` or `pyproject.toml` for every GPU machine. Run `python -c “import torch; print(torch.cuda.is_available())”` after installing to confirm hardware acceleration immediately.

Ready to try PyTorch?

Experience the full capabilities on their official website.

Visit Official Website