#9898th of 171 in Learning and cookbooks
pytorch-cpp
C++ LibTorch ports of the PyTorch tutorials, from basics to GANs
Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.
Watch puts pytorch-cpp on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.pytorch-cpp is on your watch list. Its new releases and problems show there.
- Stars
- 2.1k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- Sep 2026
- Language
- C++
2,113 on 28 Apr 20262,139 on 24 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
C++17 port of the yunjey/pytorch-tutorial examples using LibTorch. It covers basics (linear and logistic regression, feedforward nets), intermediate (CNN, ResNet, RNN, RNN-LM) and advanced topics (GAN, VAE, style transfer, image captioning), plus the 60 Minute Blitz. Each tutorial builds as its own CMake target, and a CPU Docker setup and a Colab notebook are provided.
Who it is for: C++ developers learning deep learning through the LibTorch API
Strengths
- Covers 14 tutorials from tensor basics to image captioning, each a separate CMake target
- CMake can download LibTorch for a chosen CUDA version (11.8 to 13.2) or CPU
- CI builds on macOS, Linux (gcc 14, 16) and Windows (msvc 2025)
- Dockerfile and docker-compose for CPU builds, plus a Colab notebook
Weaknesses
- Tutorials must be run from their build directory, or paths to data and models break
- Tied to LibTorch 1.12.0 to 2.14.0; interactive notebooks use nightly and may break
- Some tutorials need Python with PyTorch and torchvision to generate scriptmodule weights
- Docker image is CPU only
What it needs
- GPU optional
- Docker + Compose
- Needs LibTorch 1.12.0-2.14.0, CMake 3.28.6+, C++17 compiler, Conda (interactive notebooks)
- Models: LibTorch scriptmodule
What changed
From the release notes. No flag means the note does not say so, not that the upgrade is safe. Releases and problems by RSS
Also in Learning and cookbooks
See all 171| Rank | Project | Score |
|---|---|---|
| #96 | asl-ml-immersionGoogle Cloud ML course notebooks covering TensorFlow, MLOps and Gemini agents | 46 out of 100 |
| #97 | agents-from-scratchLangGraph tutorial notebooks that build an email-triage and reply agent | 46 out of 100 |
| #99 | prompt-engineering-guideWritten guide to prompt engineering techniques, with papers, notebooks and example prompts | 45 out of 100 |
| #100 | handson-mlJupyter notebooks for the first edition of Hands-on Machine Learning book | 45 out of 100 |
| #101 | machine_learning_examplesPython code for Lazy Programmer's online machine learning courses | 45 out of 100 |