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
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 youTop issues
#77764General MPS op coverage tracking issue1797 comments · 2022-05-18#93531TorchInductor CPU Performance Dashboard1296 comments · 2022-10-13#141287MPS operator coverage tracking issue (2.6+ version)268 comments · 2024-11-21#191009DISABLED test_index_propagation_to_dtype_inf_cpu_halide (__main__.HalideCpuTests)190 comments · 2026-07-24#47702GPU acceleration for Apple's M1 chip?183 comments · 2020-11-10#13246DataLoader num_workers > 0 causes CPU memory from parent process to be replicated in all worker processes165 comments · 2018-10-29#160230Offer official Pytorch Vulkan backend on pytorch.org132 comments · 2025-08-08#198596DISABLED test_rerun_then_pass (test.junit_xml_testdata.pytest_suite.TestJunitOutcomes)121 comments · 2026-09-25
Latest release
PyTorch 2.15.0 Release v2.15.0 2026-10-28PyTorch 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
相关报道 (6)
51CTORust 机器学习,一定要知道的这些库,可以替代 Python 库了2024-04-26智源社区GitHub 7.5k star量,各种视觉Transformer的PyTorch实现合集整理好了2021-12-31量子位可以在手机里运行的Detectron2来了:FB官方出品2021-03-0636KrGitHub 1400星,天才黑客开源深度学习框架tinygrad2020-11-26搜狐网GitHub发布年度机器学习榜:TensorFlow最火,PyTorch失踪,Julia第四2019-01-26雷峰网迎来 PyTorch,告别 Theano,2017 深度学习框架发展大盘点2017-12-31
News & coverage (23)
Hacker NewsPyTorch 1.0 is out▲ 470 · 70 comments · 2018-12-07Hacker NewsPyTorch 1.8, with AMD ROCm support▲ 313 · 138 comments · 2021-03-05Hacker NewsPyTorch v0.2.0 released▲ 150 · 14 comments · 2017-08-07Hacker NewsPyTorch 1.1▲ 43 · 2 comments · 2019-05-01Hacker NewsPyTorch 1.4: Custom mobile builds, distributed model parallel, Java bindings▲ 39 · 4 comments · 2020-01-16Hacker NewsPytorch 0.4.0 is out▲ 36 · 7 comments · 2018-04-24Hacker NewsPyTorch 1.7 Released with CUDA 11, New APIs for FFTs, Win Distributed Training▲ 29 · 1 comments · 2020-10-27Hacker NewsPyTorch 1.8 Release, including Compiler and Distributed Training updates▲ 6 · 1 comments · 2021-03-04uniteGoogle Open-Sources TorchTPU, Putting Native PyTorch on Its TPUs2026-10-20xenospectrumAMD and Intel Consolidate PyTorch CPU Optimizations in oneDNN2026-10-20