Tensors and Dynamic neural networks in Python with strong GPU acceleration
PyTorch is a Python package that provides two high-level features:
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.
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:
Elaborating Further:
If you use NumPy, then you have used Tensors (a.k.a. ndarray).

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!
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 your network behaves arbitrarily with zero lag or overhead. Our inspiration comes from several research papers on this topic, as well as current and past work such as torch-autograd, autograd, Chainer, etc.
While this technique is not unique to PyTorch, it's one of the fastest implementations of it to date. You get the best of speed and flexibility for your crazy research.

PyTorch is not a Python binding into a monolithic C++ framework. It is built to be deeply integrated into Python. You can use it naturally like you would use NumPy / SciPy / scikit-learn etc. You can write your new neural network layers in Python itself, using your favorite libraries and use packages such as Cython and Numba. Our goal is to not reinvent the wheel where appropriate.
PyTorch is designed to be intuitive, linear in thought, and easy to use. When you execute a line of code, it gets executed. There isn't an asynchronous view of the world. When you drop into a debugger or receive error messages and stack trace
LibTorch torch::pickle_save emits FP8 files that Python torch.load cannot read
https://github.com/pytorch/pytorch/issues/208211
Labels: module: cpp, module: serialization, triaged, module: floatx (formerly float8), bot-triaged
Thank you for your interest in contributing to PyTorch! If you're a new contributor, please first read the Issue and PR Workflow section, which describes how to contribute a change to PyTorch. This document is the source of truth for that process, in particular how to most effectively engage with issues and PRs.
The rest of this document covers some of the more technical aspects of contributing to PyTorch.
py-spyIssues are where we receive feedback and decide what should be done about it: bug reports, feature requests and design discussions all happen there. Once a change and design is agreed upon, pull requests are the place to discuss and verify the implementation.
For clarity, PyTorch uses labels to track the state of every issue and PR, so that both contributors and maintainers can tell what the next step is and who is expected to take it.
This workflow is being rolled out and not all of it is live yet, see Current status.
Issues are a way to report feedback or make suggestions. PyTorch uses issues to track ongoing efforts and considerations for improving the codebase. Before opening an issue, please check to see if there's already an existing issue for your topic, as it may be more effective to contribute there!
%%{init: {"htmlLabels": false, "flowchart": {"htmlLabels": false}}}%%
flowchart LR
new[New issue] --> ai(AI triage)
ai -- success --> triaged["Triaged<br/>“triaged” + “module: *” / “oncall: *” labels"]
ai -- "fails, or “no automated triage”" --> manual(Manual triage) --> triaged
triaged --> mtriage("Module-level triage<br/>any module maintainer")
mtriage --> full["Fully triaged<br/>“needs reproduction” / “needs research” /<br/>“needs design” / “actionable” / “won't fix”"]
full -- "remove the label to request<br/>re-evaluation" --> triaged
classDef state fill:#f3f4f6,stroke:#6b7280,color:#000
classDef aiproc fill:#dbeafe,stroke:#2563eb,color:#000
classDef humanproc fill:#fef3c7,stroke:#d97706,color:#000
class new,triaged,full state
class ai aiproc
class manual,mtriage humanproc
Rectangles are states. Rounded boxes are processes that move an item between states: blue for AI-based processes and orange for human-based ones.
no automated triage label, a maintainer will handle the triage instead. A triaged issue has the triaged label and one or more module: * or oncall: * labels.| Label | Meaning | What you can do |
|---|---|---|
needs reproduction | The problem has not been reproduced yet. | Reproduce the issue that was reported. A maintainer then validates it. |
needs research | We have not decided yet whether the b |