# PyTorch — card for AI agents

Deep learning framework with tensors and dynamic neural networks with GPU support.

Category: ML and data science · PyPI package `torch` · latest version 2.15.0 (checked 2026-11-01)
Install: `pip install torch`
License: Apache-2.0 AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND ISC AND MIT AND Zlib (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## PyTorch
- Take the install command from the selector at https://pytorch.org/get-started/locally/ instead of writing one from memory. The command depends on OS, package and compute platform.
- The selector labels Stable as 2.7.0, while the latest GitHub release is v2.14.1. Confirm which version the command installs before pinning.
- The site says latest Stable PyTorch requires Python 3.10 or later. Check the project's Python version before installing.
- Use the Stable build unless the user asks for Preview. Preview builds are nightly and not fully tested and supported.
- For inference, move the model to its device and call `.eval()`, then run it inside `with torch.no_grad():`, as the Hub SSD example does.
- When building from source without a given GPU toolkit, export `USE_CUDA=0`, `USE_ROCM=0` or `USE_XPU=0` to disable that backend.

## Agent Skills for it
- pytorch-lightning from K-Dense-AI/scientific-agent-skills: `npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning`
- pytorch-fsdp2 from Orchestra-Research/AI-Research-SKILLs: `npx skills add Orchestra-Research/AI-Research-SKILLs --skill pytorch-fsdp2`
- torch-profiler-layer-track from BBuf/AI-Infra-Auto-Driven-SKILLS: `npx skills add BBuf/AI-Infra-Auto-Driven-SKILLS --skill torch-profiler-layer-track`

## Docs written for agents
- [llms.txt (index of the docs)](https://pytorch.org/llms.txt)

## What it is
- PyTorch is a Python package for tensor computation with GPU acceleration and for deep neural networks built on a tape-based autograd system. The GitHub repository was created on 2016-08-13. The README breaks it into components: `torch` (a tensor library like NumPy), `torch.autograd`, `torch.nn`, `torch.multiprocessing`, and `torch.utils`, which holds the DataLoader.
- The README names two usual roles. One is a replacement for NumPy that runs on GPUs. The other is a deep learning research platform. Install commands come from a selector on pytorch.org, where you pick build, OS, package, language and compute platform. The site offers a Stable build and a nightly Preview build. It describes Stable as the most tested and supported.
- The selector page labels Stable as 2.7.0. The GitHub releases page lists v2.14.1 as the latest release, which fixes regressions and silent correctness issues.

## Caveats
- Building from source takes time and disk: A source build needs Python 3.10 or later, a compiler that fully supports C++20, at least 10 GB of free disk space, and 30-60 minutes for the first build. The README says later rebuilds are much faster.
- ROCm builds are Linux-only: The build instructions say ROCm support for AMD GPUs works only on Linux. Intel GPU support covers Linux and Windows.
- torch.distributed on Windows is a prototype: The Windows build notes call distributed package support on Windows a prototype feature that is subject to changes.
- v2.14.1 fixed silent MPS linear algebra bugs: The release lists silent correctness fixes on MPS. `torch.linalg.lstsq` gave incorrect solutions for complex batched underdetermined systems. `torch.linalg.svd` gave non-orthogonal `U` and inaccurate small singular values for rank-deficient and ill-conditioned inputs. Separately, regression fixes cover `svd`, `svdvals` and `lstsq` failing with a Metal pipeline-state error for inputs above 8192 elements.
- Install page and releases disagree: The install selector we read labels Stable as 2.7.0. The GitHub releases page lists v2.14.1 as the latest release. Check which version the generated command actually installs.

## Numbers (AgentGid data)
- Gid Score: 81.3 (#79 of all tools, 5 of 293 in its category)
- Used in 96 public projects set up for AI coding agents (1.5%)
- Downloads last week: 12,522,989 (as of 2026-11-24), -1.9% over 4 weeks
- GitHub stars: 105,706 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
NumPy 79.2%, Hugging Face Transformers 60.4%, pandas 56.2%, scikit-learn 53.1%, python-dotenv 49.0%, Matplotlib 46.9%

## Links
- AgentGid page: https://agentgid.com/tools/torch/
- Homepage: https://pytorch.org
- Repository: https://github.com/pytorch/pytorch
- Source: https://github.com/pytorch/pytorch#readme
- Source: https://github.com/pytorch/pytorch
- Source: https://github.com/pytorch/pytorch/releases
- Source: https://pytorch.org
- Source: https://pytorch.org/hub/nvidia_deeplearningexamples_ssd/

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
