{
 "kind": "tool",
 "slug": "torch",
 "path": "tools/torch/",
 "name": "PyTorch",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "ML and data science",
   "tools/ml-data-science/"
  ]
 ],
 "lead": "Deep learning framework with tensors and dynamic neural networks with GPU support.",
 "chips": [
  {
   "label": "ML and data science",
   "path": "tools/ml-data-science/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install torch"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/pytorch/pytorch"
  },
  {
   "label": "Website",
   "href": "https://pytorch.org"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "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",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from PyPI license expression.",
   "src": "https://github.com/pytorch/pytorch"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Oct 28, 2026. ",
   "src": "https://github.com/pytorch/pytorch"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "96 projects",
   "status": "info",
   "sub": "#5 of 293 in its category",
   "note": "Dependency in 96 public GitHub projects set up for AI coding agents that we scanned (1.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "yes",
   "sub": "llms.txt",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": "https://pytorch.org/llms.txt"
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What PyTorch does",
   "parts": [
    {
     "t": "prose",
     "text": "PyTorch's README pitches it as Python-first and imperative: each line executes when it is reached, and tape-based autograd lets a network change its behavior from one run to the next."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "PyTorch popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "81",
       "of": "/ 100",
       "l": "Gid Score, #79 overall"
      },
      {
       "n": "12.5M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "106K",
       "l": "GitHub stars"
      },
      {
       "n": "96",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How PyTorch is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "PyTorch is a dependency in 96 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (5.9% of the 1,623 Python ones), #5 of 293 in ml and data science.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,057; those are left out of every share on this page.",
      "Projects that use it most often also use NumPy (79.2%), Hugging Face Transformers (60.4%), pandas (56.2%).",
      "It is more common in projects set up for OpenClaw (4.5%) than for Claude Code (1.4%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "46 projects, 1.4%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "45 projects, 1.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "36 projects, 1.5%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "15 projects, 4.5%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "7 projects, 1.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "7 projects, 1.5%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 79.2% of its projects",
       "v": "NumPy",
       "path": "tools/numpy/"
      },
      {
       "l": "In 60.4% of its projects",
       "v": "Hugging Face Transformers",
       "path": "tools/transformers/"
      },
      {
       "l": "In 56.2% of its projects",
       "v": "pandas",
       "path": "tools/pandas/"
      },
      {
       "l": "In 53.1% of its projects",
       "v": "scikit-learn",
       "path": "tools/scikit-learn/"
      },
      {
       "l": "In 49.0% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 46.9% of its projects",
       "v": "Matplotlib",
       "path": "tools/matplotlib/"
      },
      {
       "l": "In 44.8% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 41.7% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "PyTorch in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Each line runs when reached",
       "v": "The README says that when you execute a line of code, it gets executed, and that there is no 'asynchronous view of the world'. It says error messages and stack traces are straightforward to understand, because the stack trace points to exactly where your code was defined."
      },
      {
       "l": "Network behavior can change per run",
       "v": "The maintainers write that PyTorch uses reverse-mode auto-differentiation, which they say lets you change how a network behaves 'arbitrarily with zero lag or overhead'. The README also notes that the technique is not unique to PyTorch."
      },
      {
       "l": "Layers written in plain Python",
       "v": "The maintainers say PyTorch is built into Python rather than bound onto a C++ framework. The same section says you can write new neural network layers in Python itself and use packages such as Cython and Numba."
      },
      {
       "l": "C/C++ layers with no wrapper code",
       "v": "For layers written in C/C++, the README describes an extension API with 'minimal boilerplate'. It links a tutorial and an example repo."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Building from source takes time and disk",
       "v": "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."
      },
      {
       "l": "ROCm builds are Linux-only",
       "v": "The build instructions say ROCm support for AMD GPUs works only on Linux. Intel GPU support covers Linux and Windows."
      },
      {
       "l": "torch.distributed on Windows is a prototype",
       "v": "The Windows build notes call distributed package support on Windows a prototype feature that is subject to changes."
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about PyTorch",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "pytorch-lightning: Deep learning framework (PyTorch Lightning / lightning package). Organize PyTorch code into LightningModules, configure Trainers for multi-G",
        "pytorch-fsdp2: Adds PyTorch FSDP2 (fully_shard) to training scripts with correct init, sharding, mixed precision/offload config, and distributed checkpoint",
        "torch-profiler-layer-track: Add verified layer-number guides and compact GPU display lanes to an existing Torch Profiler Chrome JSON trace. Use for L0/L1/... navigation"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "numpy: Array computing",
        "pandas: DataFrames",
        "transformers: Pretrained models",
        "scikit-learn: Classical ML",
        "python-dotenv: Env config",
        "requests: HTTP client"
       ]
      },
      {
       "title": "More in ML and data science",
       "path": "tools/ml-data-science/",
       "items": [
        {
         "text": "NumPy",
         "path": "tools/numpy/"
        },
        {
         "text": "pandas",
         "path": "tools/pandas/"
        },
        {
         "text": "scikit-learn",
         "path": "tools/scikit-learn/"
        },
        {
         "text": "SciPy",
         "path": "tools/scipy/"
        },
        {
         "text": "Sentence Transformers",
         "path": "tools/sentence-transformers/"
        },
        {
         "text": "Hugging Face Transformers",
         "path": "tools/transformers/"
        },
        {
         "text": "Chroma (Python)",
         "path": "tools/chromadb-pypi/"
        },
        {
         "text": "NetworkX",
         "path": "tools/networkx/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "PyTorch",
       "me": true,
       "facts": [
        "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",
        "Gid 81",
        "12.5M/wk"
       ]
      }
     ],
     "more": "Compare PyTorch with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "pip install torch"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## PyTorch\n- 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.\n- 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.\n- The site says latest Stable PyTorch requires Python 3.10 or later. Check the project's Python version before installing.\n- Use the Stable build unless the user asks for Preview. Preview builds are nightly and not fully tested and supported.\n- 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.\n- When building from source without a given GPU toolkit, export `USE_CUDA=0`, `USE_ROCM=0` or `USE_XPU=0` to disable that backend.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi torch"
  ],
  [
   "Category",
   "ML and data science"
  ],
  [
   "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"
  ],
  [
   "Latest version",
   "v2.14.1, September 30, 2026"
  ],
  [
   "On GitHub since",
   "August 2016"
  ],
  [
   "Gid Score",
   "81.3"
  ],
  [
   "Rank in category",
   "#5 of 293"
  ],
  [
   "GitHub",
   "pytorch/pytorch"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [
  "Used by Amazon Advertising, Salesforce, Stanford University, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/pytorch.png"
}