Fact-checked by Grok 2 weeks ago

PyTorch

PyTorch is an open-source framework for that enables tensor computations with GPU acceleration and facilitates the construction of deep neural networks through dynamic computation graphs. Developed initially by Meta's Research lab (), it builds on the earlier library, providing an style that supports and experimentation in areas like and . First released in alpha form in 2016, PyTorch gained public traction in early 2017 and reached stable version 1.0 in 2018, emphasizing both research flexibility and production deployment capabilities. A core strength of PyTorch lies in its autograd system, which automatically computes gradients for , allowing users to define computational graphs on-the-fly rather than statically. This dynamic approach contrasts with static graph frameworks and enables intuitive debugging and modifications during model development. Additionally, PyTorch supports distributed training across multiple GPUs and machines via the torch.distributed package, making it suitable for large-scale training workloads. For production, tools like TorchScript allow models to be serialized and optimized independently of Python, while TorchServe, now on limited maintenance, provided scalable model serving infrastructure. Since its inception, PyTorch has evolved under the governance of the PyTorch Foundation, established in 2022 as part of the AI & Data to foster an open ecosystem. PyTorch 2.0, released in 2023, introduced significant performance improvements like TorchDynamo, with versions continuing to evolve through 2025. The framework now includes a rich set of libraries, such as TorchVision for tasks, TorchAudio for audio processing, and TorchText for handling, extending its applicability across diverse AI domains. As of 2025, PyTorch powers much of the AI research and deployment at organizations like , , and , with over 210,000 GitHub stars reflecting its widespread adoption. Its emphasis on Pythonic interfaces and community contributions continues to drive innovations in , including support for advanced hardware like GPUs and TPUs.

Overview

Introduction

PyTorch is an open-source library developed by for building and training models, originally based on the library and widely used for applications in , , and generative AI. It provides a flexible framework that enables researchers and developers to create complex neural networks efficiently, emphasizing ease of use while maintaining high performance. The library is licensed under the permissive BSD-3-Clause license, allowing broad adoption in both academic and commercial settings. Since 2022, PyTorch has been governed by the PyTorch Foundation, hosted under the , to foster community-driven development and ensure long-term sustainability. At its core, PyTorch features a Python frontend for intuitive scripting paired with a performant C++ backend, supporting dynamic computation graphs that allow models to be defined and modified on the fly during execution. This architecture includes tensors as the fundamental for numerical computations and Autograd for , enabling seamless gradient tracking in training. PyTorch excels in research prototyping thanks to its dynamic and Pythonic design, which facilitates rapid experimentation and , while its of extensions supports scalable deployments for real-world systems.

Key Features

PyTorch's dynamic computation graphs enable runtime modifications and eager execution, allowing developers to define and alter computational flows on-the-fly during model execution, in contrast to the static graphs used in frameworks like . This imperative approach, rooted in Python's dynamic nature, supports flexible experimentation and straightforward , as operations are executed immediately rather than being predefined in a fixed structure. The framework's Pythonic interface emphasizes intuitive usability, with tensor operations mirroring NumPy's syntax for seamless multi-dimensional array handling and integration with existing scientific computing workflows. This design, combined with built-in support for via Autograd, simplifies the development of complex models while maintaining high performance. PyTorch also provides native GPU acceleration through backends including for devices, for hardware, and Metal for , facilitating efficient parallel processing on diverse accelerators. Extensibility is a core strength, achieved via custom C++ extensions that allow integration of high-performance, low-level code for specialized operations, and just-in-time (JIT) compilation in PyTorch 2.0 and later, which optimizes dynamic code through .compile for substantial speedups. Furthermore, distributed capabilities via the torch.distributed package enable scalable parallelism across multiple GPUs or machines, supporting collective communication primitives and strategies like DistributedDataParallel for large-scale model .

History

Origins and Development

PyTorch's foundational roots lie in the Torch library, a modular framework originally developed in 2002 at the Idiap Research Institute by Ronan Collobert, , and Johnny Mariéthoz. This Lua-based system emphasized efficient tensor operations and scientific computing, providing a flexible environment for implementing algorithms, which directly inspired PyTorch's core tensor computation engine. Subsequent evolution into Torch7 around 2011, led by Collobert and collaborators including Koray Kavukcuoglu and Clément Farabet at (NYU), enhanced the framework with LuaJIT interfaces for GPU acceleration and applications, further solidifying its influence on modern tools. Recognizing Lua's adoption barriers for the broader Python-centric research community, development of PyTorch commenced in early 2016 at AI Research (FAIR), spearheaded by Soumith Chintala alongside , Adam Paszke, and Gregory Chanan. The project aimed to bridge Torch's robust C++ backend with Python's accessibility, prioritizing dynamic computational graphs to facilitate and in AI research, in contrast to more rigid static graph alternatives prevalent at the time. PyTorch debuted as a Python wrapper over the existing Torch infrastructure in its initial public release on , , marking a pivotal shift toward Python-native workflows. From the outset, it was released as under FAIR's stewardship, hosted on to encourage collaborative development and contributions from the global community, with (formerly ) continuing as the primary maintainer.

Major Releases and Updates

PyTorch's stable 1.0 release arrived on December 7, 2018, marking a pivotal shift toward production readiness with stabilized , improved distributed via DistributedDataParallel, and native support for exporting models to the ONNX for interoperability across frameworks. This version solidified PyTorch's dual appeal for research and deployment, enabling seamless transitions from prototyping to scalable applications without major refactoring. Subsequent releases built on this foundation, with PyTorch 1.5 launched on April 21, 2020, introducing enhancements for mobile deployment through improved TorchScript optimizations and new APIs for efficient model export to edge devices. It also featured a major update to the C++ frontend and channels-last memory format for tasks, alongside stable releases of domain libraries like TorchVision 0.6.0 with additional pre-trained models. By PyTorch 1.8 on March 4, 2021, TorchScript reached full maturity as version 1.0, supporting advanced scripting and tracing for production inference, while adding backend improvements and distributed refinements. The landmark PyTorch 2.0, released on March 15, 2023, introduced torch.compile, a transformative that lowers graphs for backend-specific optimizations, delivering up to 2x speedups in and across diverse . This release emphasized Pythonic ease-of-use while advancing performance through integrations like scaled_dot_product_attention with FlashAttention-2, reducing memory usage in models. In 2024 and 2025, PyTorch continued rapid iteration, with version 2.5 on October 17, 2024, enhancing the TorchInductor backend for superior CPU and GPU kernel fusion, including FP16 support and ahead-of-time compilation modes that boosted throughput for complex models. PyTorch 2.6, released January 29, 2025, added full Python 3.13 compatibility, enabling torch.compile usage on the latest Python runtime for broader ecosystem alignment. PyTorch 2.7, released April 23, 2025, introduced support for NVIDIA's Blackwell GPU architecture and pre-built wheels for CUDA 12.8. PyTorch 2.8, released August 6, 2025, provided a limited stable libtorch ABI for third-party extensions. PyTorch 2.9, released October 15, 2025, expanded wheel support for AMD ROCm, Intel XPU, and NVIDIA CUDA 13. Concurrently, deeper integration with Apple Silicon advanced via the Metal Performance Shaders (MPS) backend. Governance evolved significantly in 2022 with the establishment of the PyTorch Foundation on September 12, under the , to foster vendor-neutral collaboration among industry leaders like , , and , ensuring sustainable open-source development. This shift promoted standardized resources and accelerated research contributions from a diverse community.

Core Components

Tensors

In PyTorch, tensors are the core data structure, representing multi-dimensional arrays of numerical values with a single data type, analogous to NumPy's ndarrays but extended with native support for GPU acceleration and optional operation tracking for . These structures enable efficient storage and manipulation of data in workflows, supporting dimensions from scalars (0D) to high-dimensional arrays. Tensors are created through various factory functions in the module. The primary method, torch.tensor(data), constructs a tensor from input data such as lists, NumPy arrays, or scalars, automatically inferring the unless specified. For initialized tensors, torch.zeros(shape) generates a tensor filled with zeros, torch.ones(shape) with ones, and torch.rand(shape) with elements drawn from a in [0, 1). , or dtypes, can be explicitly set for control, such as dtype=torch.float32 for single-precision floating-point or dtype=torch.int64 for 64-bit integers, ensuring compatibility with specific computations.
python
import torch

# From data
data = [[1.0, 2.0], [3.0, 4.0]]
x = torch.tensor(data, dtype=torch.float32)

# Initialized
y = torch.zeros((2, 2), dtype=torch.float32)
z = torch.rand((2, 2))
Basic operations on tensors mirror mathematical conventions and semantics for intuitive use. Element-wise addition applies the + operator directly, as in tensor1 + tensor2, producing a new tensor with corresponding elements summed. for 2D tensors uses torch.mm(A, B) or, in 3.5+, the @ operator (A @ B), computing the standard linear algebra product. Reshaping reorganizes the tensor's dimensions without altering data via tensor.view(new_shape), which returns a sharing the same underlying storage if the total element count matches; otherwise, it raises an error.
python
# Element-wise addition
a = torch.tensor([1.0, 2.0])
b = torch.tensor([3.0, 4.0])
c = a + b  # tensor([4.0, 6.0])

# Matrix multiplication
A = torch.tensor([[1.0, 2.0], [3.0, 4.0]])
B = torch.tensor([[5.0, 6.0], [7.0, 8.0]])
C = A @ B  # tensor([[19.0, 22.0], [43.0, 50.0]])

# Reshaping
d = torch.rand((4, 3))
e = d.view(3, 4)  # Flattens and reshapes to (3, 4)
PyTorch implements broadcasting rules to perform operations on tensors of incompatible shapes efficiently, without data duplication. Tensors are broadcast-compatible if, aligning shapes from the trailing dimensions, they are identical or one has size 1 in that dimension (which expands implicitly to match). For instance, adding a 1D tensor of shape (3,) to a 2D tensor of shape (4, 3) treats the 1D tensor as (1, 3) and replicates it across the first dimension. This mechanism, inherited from , optimizes memory and computation for operations like element-wise arithmetic across batches. Device placement determines where tensor computations occur, defaulting to CPU for . To leverage GPU , use tensor.to('cuda') or tensor.cuda() to transfer the tensor and its data to , enabling parallel acceleration on compatible . Conversely, tensor.cpu() relocates it back to for CPU operations or data export. These methods manage asynchronous copies and ensure device consistency, with multiple GPUs selectable via to('cuda:0') for specific indices. Tensors support autograd integration by setting requires_grad=True at , allowing operation tracking without altering manipulation.
python
# Device transfer
if torch.cuda.is_available():
    x = x.to('cuda')  # Or x.cuda()
    y = y.cpu()  # Back to CPU

Autograd

PyTorch's Autograd is an engine that enables the computation of gradients for tensor-based computations, powering the training of neural networks through . It operates on a define-by-run , where the computational is constructed dynamically during the forward pass as operations are executed on tensors. This approach allows for flexible, imperative-style programming while recording the necessary information for gradient computation without a predefined static graph. To enable gradient tracking, the requires_grad attribute of a tensor must be set to True, typically via tensor.requires_grad_(True) or by creating the tensor with this flag. Once enabled, Autograd records all operations performed on the tensor, building a (DAG) where nodes represent either leaf tensors (inputs with requires_grad=True) or intermediate results from operations. This graph captures the dependencies needed for , allowing to flow back through the chain rule during the backward pass. Backward propagation is initiated by calling loss.backward() on a scalar loss tensor, which traverses the computational in reverse, computing partial derivatives with respect to all leaf tensors using and accumulating results in their .grad attributes. For efficiency during or when gradients are unnecessary, the context manager torch.no_grad() can be used to temporarily disable gradient tracking, preventing the from being built and reducing memory usage without affecting computation. For scenarios involving multiple outputs or custom gradient computations, the function torch.autograd.grad(outputs, inputs) directly computes and returns the gradients of the specified outputs with respect to the inputs, providing a vector-Jacobian product without populating .grad attributes. To explicitly break the computational graph and prevent further gradient flow from a tensor, tensor.detach() returns a new tensor that shares data but is detached from the graph, effectively treating it as a leaf without history. Tensors serve as the foundational inputs to this autograd system.

Neural Networks

Module System

The torch.nn module in PyTorch provides the foundational building blocks for constructing through reusable components known as modules. At its core is the nn.Module class, which serves as the base class for all neural network modules, enabling users to define custom models by subclassing it. Subclassing nn.Module involves implementing the __init__ method to initialize layers and other submodules as instance attributes, and the forward method to specify the computation graph through which input tensors flow during inference or training. For instance, a simple feedforward network might be defined as follows:
python
import torch.nn as nn

class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.fc = nn.Linear(10, 5)
    
    def forward(self, x):
        return self.fc(x)
This structure ensures that all submodules are properly registered, allowing PyTorch to track parameters and buffers automatically. PyTorch includes a variety of predefined layer modules within nn for common operations. The nn.Linear module implements a linear transformation of the form y = xA^T + b, where A is a learnable weight matrix of size (N, *, H_{in}) by (N, *, H_{out}) and b is a learnable bias vector of size (N, *, H_{out}), instantiated with parameters in_features and out_features. For convolutional layers, nn.Conv2d applies 2D over input planes, taking parameters such as in_channels (number of input channels), out_channels (number of output channels), and kernel_size (size of the convolving ). Activation functions like nn.ReLU apply the rectified linear unit element-wise, computing \text{ReLU}(x) = \max(0, x), and can be added directly as submodules without additional parameters. These layers integrate seamlessly with the autograd system, where tensors flow through the forward pass and gradients are computed automatically for learnable parameters. Modules distinguish between learnable parameters and non-learnable buffers. The parameters() (or named_parameters() for named access) yields an over all learnable parameters, which are typically used by optimizers for updates, such as the weights in nn.Linear or nn.Conv2d. Buffers, on the other hand, are tensors that are part of the module's but do not require gradients; they are registered using register_buffer(name, tensor) to ensure they are moved with the model and saved in checkpoints. For example, in nn.BatchNorm2d, the running mean and running variance—updated as exponential moving averages during training—are stored as buffers to normalize inputs during . This separation allows modules to maintain statistics like running means without treating them as optimizable parameters. To organize complex architectures, PyTorch offers container modules like nn.Sequential and nn.ModuleList. The nn.Sequential class creates an ordered container where modules are executed sequentially on input data, ideal for linear stacks such as alternating linear layers and activations; it accepts modules or an OrderedDict in its constructor. For more flexible structures, such as dynamic or variable-length lists of submodules (e.g., blocks or heads), nn.ModuleList holds a list of modules that are properly registered, allowing indexing like a standard list while ensuring visibility to module methods like parameters(). Unlike plain lists, using nn.ModuleList integrates the submodules into the parent's and tracking. Device management is handled uniformly across modules via the to(device) method, which recursively moves the entire model—including all parameters and buffers—to the specified device (e.g., CPU or GPU), ensuring compatibility with . This operation is essential for leveraging PyTorch's support for multi-device and .

Building and Training Models

In PyTorch, models are defined by subclassing the nn.Module class, where the __init__ method initializes layers and parameters, and the forward method specifies the computation performed on input data. For example, a simple (MLP) for image classification can be constructed using sequential linear layers and activation functions, as shown in the following code snippet for classifying images:
python
import torch
from torch import nn

class NeuralNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.flatten = nn.Flatten()
        self.linear_relu_stack = nn.Sequential(
            nn.Linear(28 * 28, 512),
            nn.ReLU(),
            nn.Linear(512, 512),
            nn.ReLU(),
            nn.Linear(512, 10),
        )

    def forward(self, x):
        x = self.flatten(x)
        logits = self.linear_relu_stack(x)
        return logits
This structure enables flexible assembly of complex architectures by composing predefined modules. The training process in PyTorch typically involves a loop over epochs and batches from a data loader, where each iteration computes model outputs on input tensors, calculates the loss, performs backpropagation via autograd, and updates parameters using an optimizer. The core structure is as follows:
python
for epoch in range(epochs):
    for batch in dataloader:
        inputs, targets = batch
        outputs = model(inputs)
        loss = criterion(outputs, targets)
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
This manual loop provides fine-grained control over the training dynamics. PyTorch offers a variety of built-in loss functions in the torch.nn module to measure the difference between predictions and targets. For multi-class classification tasks, nn.CrossEntropyLoss combines log softmax and negative log-likelihood loss, suitable for raw logits as outputs. In problems, nn.MSELoss computes the between predicted and true continuous values. Optimizers in the torch.optim module adjust model parameters to minimize the loss, with (SGD) being a foundational that updates weights via a and optional momentum: optimizer = torch.optim.SGD(model.parameters(), lr=0.01, momentum=0.9). Adaptive methods like incorporate momentum and adaptive learning rates, often with weight decay for regularization: optimizer = torch.optim.Adam(model.parameters(), lr=0.001, weight_decay=1e-5). A complete example of building and training a simple convolutional neural network for MNIST digit classification demonstrates these components in approximately 20 lines of core code, excluding imports and data loading:
python
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
        self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
        self.conv2_drop = nn.Dropout2d()
        self.fc1 = nn.Linear(320, 50)
        self.fc2 = nn.Linear(50, 10)

    def forward(self, x):
        x = F.relu(F.max_pool2d(self.conv1(x), 2))
        x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
        x = x.[view](/page/View)(-1, 320)
        x = F.relu(self.fc1(x))
        x = F.dropout(x, training=self.training)
        x = self.fc2(x)
        return x

model = [Net](/page/.NET)()
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.5)

for [epoch](/page/Epoch) in range(1, 3):  # Example with 2 epochs
    for data, target in trainloader:
        optimizer.zero_grad()
        output = model(data)
        loss = criterion(output, target)
        loss.backward()
        optimizer.step()
This setup achieves high accuracy on MNIST after sufficient epochs, leveraging tensors for data representation and autograd for gradient computation.

Ecosystem and Deployment

PyTorch's ecosystem includes several domain-specific libraries that build upon its core tensor and autograd functionalities to facilitate specialized tasks in . TorchVision, an official library for , offers popular datasets such as and , along with pre-trained models like ResNet and transformations for image preprocessing. Similarly, TorchAudio extends PyTorch for audio and , providing datasets like LibriSpeech, models for such as wav2vec, and utilities for audio I/O and transformations. TorchText, focused on , supplies datasets including Multi30k and AG News, tokenizers, and data loading pipelines for text-based tasks, though its active development has been paused since 2023. For research-oriented tools, Captum provides interpretability methods to analyze PyTorch models, supporting techniques like Integrated Gradients and Layer-wise Relevance Propagation across , text, and other modalities. TorchMetrics offers a collection of over 100 evaluation metrics for tasks like , , and segmentation, with support for and custom metric creation. Integration libraries such as Transformers leverage PyTorch as a backend to access thousands of pre-trained models for , , audio, and multimodal applications, enabling easy fine-tuning and inference with architectures like and . ExecuTorch enables deployment of PyTorch models on mobile, edge, and embedded devices, including and , supporting optimized inference through torch.export and integration with hardware accelerators. Released in general availability as version 1.0 in October 2025, it pairs with built-in quantization tools like torch.quantization for reducing model size and improving efficiency via post-training or quantization-aware training. Community-driven extensions further broaden PyTorch's applicability; , developed by , is a platform for and segmentation, implementing state-of-the-art models like Faster R-CNN and Mask R-CNN with modular components for custom research. Fairseq, also from , is a sequence modeling toolkit for tasks such as and summarization, featuring scalable training for Transformer-based models and support for multilingual datasets.

Production Tools

PyTorch provides several tools and techniques to facilitate the deployment of models in environments, enabling efficient , interoperability, and optimization for various targets. These tools bridge the gap between in and scalable, low-latency serving in C++ or other runtimes, while supporting model compression to meet resource constraints on edge and cloud platforms. TorchScript allows developers to convert PyTorch models into a serializable suitable for deployment, particularly for C++ . It supports two primary compilation methods: tracing via torch.jit.trace(model, example_inputs), which records operations on sample inputs to create a static graph, and scripting via torch.jit.script(model), which compiles the model's source code into TorchScript syntax for dynamic . The resulting ScriptModule can be saved with torch.jit.save and loaded in C++ environments using the , enabling high-performance without dependencies. However, TorchScript has been deprecated in favor of torch.export as of PyTorch , with ongoing support for legacy use cases. For broader interoperability, PyTorch supports exporting models to the (ONNX) format, which allows integration with diverse inference engines such as TensorRT or ONNX Runtime. The core function torch.onnx.export(model, dummy_input, "model.onnx") generates an ONNX graph from a PyTorch module by tracing its execution on a representative input, preserving operations like convolutions and activations. Recent updates in PyTorch 2.5 and later introduce a dynamo=True option, leveraging torch.export for improved handling of dynamic shapes and , resulting in more robust ONNX models with annotations for . This export process ensures compatibility across frameworks, facilitating deployment in heterogeneous production pipelines. TorchServe is a flexible serving designed for hosting PyTorch models as scalable RESTful in production. It supports multi-model serving on a single instance, automatic batching of inference requests, and built-in metrics for monitoring latency and throughput via Prometheus integration. Models are packaged using the torch-model-archiver tool into .mar files containing the TorchScript or eager-mode artifact, handlers for preprocessing/postprocessing, and dependencies; serving is initiated with torchserve --start --model-store model_store --models mymodel.mar. While effective for and on-premises deployments, TorchServe is no longer actively maintained by the PyTorch team as of , with recommendations to explore alternatives like KServe for advanced orchestration. Quantization techniques in PyTorch optimize models for by reducing from floating-point to integers, thereby decreasing model size and accelerating on resource-limited devices. Post-training quantization (PTQ), applied after model training, includes dynamic methods like torch.quantization.quantize_dynamic(model, {torch.nn.Linear}, dtype=torch.qint8) for linear layers, which quantizes weights on-the-fly during while keeping activations in full precision. Static PTQ, involving calibration on a representative , fuses operations and inserts observers to scale activations, achieving up to 4x speedups on CPU hardware with minimal accuracy loss for tasks like image classification. These optimizations are particularly valuable for deployment, where torch.backends.quantized.engine = 'qnnpack' selects mobile-friendly backends. In 2025, PyTorch introduced enhancements to torch.compile, a backend that optimizes models for faster on through graph-level fusions and selections. PyTorch 2.9, released in October 2025, improved torch.compile with better backend support, expanded TorchInductor options for symmetric quantization, and performance gains on TorchBench workloads. These updates, including 3.13 compatibility and refined AOTAutograd integration, streamline production pipelines by reducing compilation overhead and enhancing scalability for large-scale serving.

References

  1. [1]
    pytorch/pytorch: Tensors and Dynamic neural networks in Python ...
    PyTorch is a Python package that provides two high-level features: Tensor computation (like NumPy) with strong GPU acceleration; Deep neural networks built ...Pytorch · Release Notes · Examples · Pytorch/extension-cpp
  2. [2]
    PyTorch: Imperative Deep Learning Library
    Dec 3, 2019 · PyTorch is a machine learning library that shows that these two goals are in fact compatible: it provides an imperative and Pythonic programming style.
  3. [3]
    PyTorch developer ecosystem expands, 1.0 stable release now ...
    Dec 7, 2018 · When PyTorch first launched in early 2017, it quickly became a popular choice among AI researchers, who found it ideal for rapid experimentation ...
  4. [4]
  5. [5]
    PyTorch 2.9 documentation
    PyTorch is an optimized tensor library for deep learning using GPUs and CPUs. Features described in this documentation are classified by release status: Stable ...
  6. [6]
    PyTorch Distributed Overview
    This is the overview page for the torch.distributed package. The goal of this page is to categorize documents into different topics and briefly describe ...DDP · Distributed Data Parallel in... · Writing Distributed... · DistributedDataParallel
  7. [7]
    PyTorch Grows as the Dominant Open Source Framework for AI and ...
    Dec 23, 2024 · The PyTorch Foundation was formed in 2022 with the goal to drive the adoption of AI tooling by fostering and sustaining an ecosystem of open ...Missing: initial | Show results with:initial
  8. [8]
  9. [9]
    PyTorch Overview - NVIDIA Docs Hub
    PyTorch is a GPU-accelerated tensor computational framework with a Python front end. Functionality can be easily extended with common Python libraries.
  10. [10]
    PyTorch - AI at Meta
    PyTorch is an open source deep learning framework built to be flexible and modular for research, with the stability and support needed for production...
  11. [11]
    PyTorch
    A rich ecosystem of tools and libraries extends PyTorch and supports development in computer vision, NLP and more.Tutorials · PyTorch Documentation · Learn · Torch
  12. [12]
    torch - PyPI
    PyTorch has a BSD-style license, as found in the LICENSE file. Project ... License: BSD-3-Clause; Author: PyTorch Team; Tags pytorch , machine learning ...
  13. [13]
    Welcoming PyTorch to the Linux Foundation
    Sep 12, 2022 · As part of the Linux Foundation, PyTorch and its community will benefit from our many programs and support communities like training and ...Missing: BSD- Clause
  14. [14]
    PyTorch gets lit under The Linux Foundation - The Register
    ... PyTorch." PyTorch, under a BSD-3-Clause license plus the Apache Contributor License Agreement, is one of the major deep learning frameworks ...
  15. [15]
    PyTorch: Open Source Deep Learning Framework
    PyTorch is an open source deep learning framework built to be flexible and modular for research, with the stability and support needed for production deployment ...Missing: official | Show results with:official
  16. [16]
    What is PyTorch? | Data Science | NVIDIA Glossary
    PyTorch is based on dynamic computation graphs, where the computation graph is built and rebuilt at runtime, with the same code that performs the computations ...Why Pytorch? · Graphs · Pytorch Use Cases
  17. [17]
    Learning PyTorch with Examples
    At its core, PyTorch provides two main features: An n-dimensional Tensor, similar to numpy but can run on GPUs. Automatic differentiation for building and ...Missing: key | Show results with:key
  18. [18]
    PyTorch 2.x
    Learn about PyTorch 2.x: faster performance, dynamic shapes, distributed training, and torch.compile.
  19. [19]
    PyTorch's design origins
    Dec 17, 2023 · The groundwork for PyTorch originally started in early 2016, online, among a band of Torch7's contributors. Torch7 (~2010-2017). These days, we ...
  20. [20]
    The road to 1.0: production ready PyTorch
    May 2, 2018 · We aim to release 1.0 some time during the summer. You can follow-along our progress on the Pull Requests page. You can read this from the ...
  21. [21]
    PyTorch 1.5 released, new and updated APIs including C++ ...
    Apr 21, 2020 · This release includes several major new API additions and improvements. PyTorch now includes a significant update to the C++ frontend, 'channels ...
  22. [22]
    PyTorch library updates including new model serving library
    Apr 21, 2020 · Along with the PyTorch 1.5 release, we are announcing new libraries for high-performance PyTorch model serving and tight integration with ...
  23. [23]
    New PyTorch library releases including TorchVision Mobile ...
    Mar 4, 2021 · Today, we are announcing updates to a number of PyTorch libraries, alongside the PyTorch 1.8 release. The updates include new releases for ...
  24. [24]
    PyTorch 2.0: Our next generation release that is faster, more ...
    Mar 15, 2023 · We are excited to announce the release of PyTorch® 2.0 which we highlighted during the PyTorch Conference on 12/2/22! PyTorch 2.0 offers the ...Beta Features · (beta) Torch. Compile · (beta) Gnn Inference And...Missing: first | Show results with:first
  25. [25]
    PyTorch 2.5 Release Blog
    Oct 17, 2024 · Finally, TorchInductor CPP backend offers solid performance speedup with numerous enhancements like FP16 support, CPP wrapper, AOT-Inductor ...Beta Features · (beta) Torchinductor Cpu... · Prototype Features
  26. [26]
    PyTorch 2.6 Release Blog
    Jan 29, 2025 · compile support for Python 3.13. torch.compile previously only supported Python up to version 3.12. Users can now optimize models with torch ...
  27. [27]
    Introducing Accelerated PyTorch Training on Mac
    May 18, 2022 · Accelerated GPU training is enabled using Apple's Metal Performance Shaders (MPS) as a backend for PyTorch. The MPS backend extends the PyTorch ...
  28. [28]
    Announcing the PyTorch Foundation: A new era for the cutting-edge ...
    Sep 12, 2022 · To accelerate progress in AI, PyTorch is moving to a new, independent PyTorch Foundation, under the Linux Foundation umbrella.<|control11|><|separator|>
  29. [29]
  30. [30]
    torch.zeros — PyTorch 2.7 documentation
    Returns a tensor filled with the scalar value 0 , with the shape defined by the variable argument size . Parameters. size (int...) – a ...
  31. [31]
    Overview of PyTorch Autograd Engine
    Jun 8, 2021 · PyTorch computes the gradient of a function with respect to the inputs by using automatic differentiation.
  32. [32]
  33. [33]
    torch.nn — PyTorch 2.7 documentation
    These are the basic building blocks for graphs: torch.nn Containers, Global Hooks, For Module, Convolution Layers, Pooling layers, Padding Layers, Non-linear ...<|control11|><|separator|>
  34. [34]
  35. [35]
  36. [36]
    Introduction - Captum
    Captum helps ML researchers more easily implement interpretability algorithms that can interact with PyTorch models. It also allows researchers to quickly ...
  37. [37]
    Detectron2 is a platform for object detection, segmentation ... - GitHub
    Detectron2 is Facebook AI Research's next generation library that provides state-of-the-art detection and segmentation algorithms.
  38. [38]
    facebookresearch/fairseq: Facebook AI Research Sequence-to ...
    Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling ...Issues 1.2k · Pull requests 151 · AttributeError: 'Wav2VecCtc... · Workflow runs
  39. [39]
    TorchScript — PyTorch 2.9 documentation
    Sep 7, 2018 · TorchScript#. Created On: Sep 07, 2018 | Last Updated On: Jul 16, 2025. Warning. TorchScript is deprecated, please use torch.export instead.TorchScript language reference · Torch.jit.script · TorchScript Language...
  40. [40]
    torch.jit.script — PyTorch 2.9 documentation
    Module will inspect the source code, compile it as TorchScript code using the TorchScript compiler, and return a ScriptModule or ScriptFunction .
  41. [41]
    torch.onnx — PyTorch 2.9 documentation
    Jun 10, 2025 · Exports a model into ONNX format. Setting dynamo=True enables the new ONNX export logic which is based on torch.export.ExportedProgram and a ...
  42. [42]
    torch.export-based ONNX Exporter — PyTorch 2.9 documentation
    Jun 10, 2025 · During ONNX export, each ONNX node is annotated with metadata that helps trace its origin and context from the original PyTorch model. This ...
  43. [43]
    Export a PyTorch model to ONNX
    Oct 4, 2023 · Install the required dependencies. · Author a simple image classifier model. · Export the model to ONNX format. · Save the ONNX model in a file.
  44. [44]
    TorchServe — PyTorch/Serve master documentation
    TorchServe is a tool for serving PyTorch models in production, but it is no longer actively maintained.Running TorchServe · TorchServe Metrics · Logging in Torchserve · Model Zoo
  45. [45]
    Running TorchServe — PyTorch/Serve master documentation
    TorchServe can be used for many types of inference in production settings. It provides an easy-to-use command line interface and utilizes REST based APIs ...
  46. [46]
    Getting started — PyTorch/Serve master documentation
    To start with TorchServe, install TorchServe and model archiver, then clone the repo, archive a model, and use `torchserve --start` to serve it.
  47. [47]
    Quantization — PyTorch 2.9 documentation
    Oct 9, 2019 · The Quantization API Reference contains documentation of quantization APIs, such as quantization passes, quantized tensor operations, and ...
  48. [48]
    Practical Quantization in PyTorch
    Feb 8, 2022 · In this blog post, we'll lay a (quick) foundation of quantization in deep learning, and then take a look at how each technique looks like in practice.In Pytorch · Post-Training Static... · Quantization-Aware Training...
  49. [49]
    Quantization Overview — torchao 0.13 documentation - PyTorch
    Quantization Aware Training. TorchAO supports quantization aware training through the quantize_ API as well. Low Bit Optimizers. We support low bit optimizers ...
  50. [50]
    PyTorch 2.9 Release Blog
    Oct 15, 2025 · PyTorch 2.9 delivers key backend improvements on Arm with better performance and test coverage. torch.compile Improvements: TorchBench, ...Api-Unstable Features · (api-Unstable) Symmetric... · (api-Unstable) Expanded...
  51. [51]
    Introduction to torch.compile - PyTorch
    Oct 15, 2025 · This introduction covers basic torch.compile usage and demonstrates the advantages of torch.compile over our previous PyTorch compiler solution, ...
  52. [52]
    February, 2025 - PyTorch
    May 13, 2025 · We're excited to announce the release of PyTorch 2.6! This release features multiple improvements for PT2. torch.compile can now be used with ...Missing: inductor | Show results with:inductor