pytorch /pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

★ 105,307⑂ 30,618👁 1,792⑃ 140,888● 62,391▤ 71◈ 0
PythonNOASSERTIONCreated 2016-08-13pytorch.org
105,307
stars
+30+222+1,530
30,618
forks
1,792
watchers
140,888
prs
62,391
issues
71
releases
0
discussions

README

--------------------------------------------------------------------------------

PyTorch is a Python package that provides two high-level features:
- Tensor computation (like NumPy) with strong GPU acceleration
- Deep neural networks built on a tape-based autograd system

You can reuse your favorite Python packages such as NumPy, SciPy, and Cython to extend PyTorch when needed.

Our trunk health (Continuous Integration signals) can be found at hud.pytorch.org.



- More About PyTorch
  - A GPU-Ready Tensor Library
  - Dynamic Neural Networks: Tape-Based Autograd
  - Python First
  - Imperative Experiences
  - Fast and Lean
  - Extensions Without Pain
- Installation
  - Binaries
    - NVIDIA Jetson Platforms
  - From Source
    - Prerequisites
      - NVIDIA CUDA Support
      - AMD ROCm Support
      - Intel GPU Support
    - Get the PyTorch Source
    - Install Dependencies
    - Install PyTorch
      - Adjust Build Options (Optional)
  - Docker Image
    - Using pre-built images
    - Building the image yourself
  - Previous Versions
- Getting Started
- Resources
- Communication
- Releases and Contributing
- The Team
- License



 More About PyTorch

Learn the basics of PyTorch

At a granular level, PyTorch is a library that consists of the following components:

| Component | Description |
| ---- | --- |
| torch | A Tensor library like NumPy, with strong GPU support |
| torch.autograd | A tape-based automatic differentiation library that supports all differentiable Tensor operations in torch |
| torch.nn | A neural networks library deeply integrated with autograd designed for maximum flexibility |
| torch.multiprocessing | Python multiprocessing, but with magical memory sharing of torch Tensors across processes. Useful for data loading and Hogwild training |
| torch.utils | DataLoader and other utility functions for convenience |

Usually, PyTorch is used either as:

- A replacement for NumPy to use the power of GPUs.
- A deep learning research platform that provides maximum flexibility and speed.

Elaborating Further:

 A GPU-Ready Tensor Library

If you use NumPy, then you have used Tensors (a.k.a. ndarray).

!Tensor illustration

PyTorch provides Tensors that can live either on the CPU or the GPU and accelerates the
computation by a huge amount.

We provide a wide variety of tensor routines to accelerate and fit your scientific computation needs
such as slicing, indexing, mathematical operations, linear algebra, reductions.
And they are fast!

 Dynamic Neural Networks: Tape-Based Autograd

PyTorch has a unique way of building neural networks: using and replaying a tape recorder.

Most frameworks such as TensorFlow, Theano, Caffe, and CNTK have a static view of the world.
One has to build a neural network and reuse the same structure again and again.
Changing the way the network behaves means that one has to start from scratch.

With PyTorch, we use a technique called reverse-mode auto-differentiation, which allows you to
change the way you

Top issues

Latest release

PyTorch 2.15.0 Release v2.15.0 2026-10-28
PyTorch 2.15.0 Release Notes

- Highlights
- Backwards Incompatible Changes
- Deprecations
- New Features
- Improvements
- Bug fixes
- Performance
- Documentation
- Security
- Developers

 Highlights


  Rewritten NCCL backend becomes the default, with a flight recorder that dumps on hangs and TORCH_DIST_USE_NCCL2=0 or nccl-legacy as rollback paths
  One-sided transports for torch.distributed, with a NIXL backend and CUDA-graph-capturable transfers
  FSDP2 and pipelining gain finer memory and communication control, with fp32 for precision-sensitive parameters, CUDA-graph-captured gradient accu

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON