As of 2026-09-07 (commit c0b76369a313), pytorch/pytorch contains 3,212,571 total lines: 2,513,028 code, 333,203 comments, 366,340 blank, across 8,675 files in 33 languages (top: Python 46.2%). Counted with tokei via OctoCounts.
OctoCounts produced this report by resolving pytorch/pytorch to commit c0b76369a313, downloading the repository source archive, and counting every source file with tokei, the open-source line counter written in Rust. The table below breaks the count down by programming language into files, total lines, code lines, comment lines, and blank lines, so the figures can be compared across languages and projects. Results are cached by commit, tokei version, and analysis options, so counting the same revision again reproduces exactly these numbers.
This is a very large codebase by counted code lines. Code represents 78.2% of all lines, comments represent 10.4%, and the repository averages 290 code lines per file. Python accounts for 46.2% of counted code.
| Language | Files | Lines | Code | Comments | Blanks |
|---|---|---|---|---|---|
| Python | 3111 | 1440985 | 1161582 | 106805 | 172598 |
| C++ | 1745 | 818567 | 660133 | 78478 | 79956 |
| C Header | 2248 | 591815 | 435525 | 80822 | 75468 |
| CUDA | 324 | 87493 | 72176 | 6352 | 8965 |
| C | 193 | 42475 | 35569 | 2729 | 4177 |
| Objective-C++ | 117 | 38280 | 31602 | 2305 | 4373 |
| Metal Shading Language | 51 | 25180 | 21384 | 1707 | 2089 |
| YAML | 13 | 21269 | 16673 | 1164 | 3432 |
| CMake | 111 | 22263 | 15934 | 4022 | 2307 |
| C++ Header | 85 | 18248 | 12546 | 3037 | 2665 |
| Bazel | 48 | 13048 | 11933 | 469 | 646 |
| GNU Style Assembly | 42 | 11207 | 9109 | 313 | 1785 |
Top language (Python 46.2%). Generated at 2026-09-07T08:24:49.458399685+00:00.
pytorch/pytorch has 3,212,571 total lines, including 2,513,028 code lines, 333,203 comment lines, and 366,340 blank lines.
OctoCounts resolved the public GitHub repository to commit c0b76369a313, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.
This OctoCounts report was generated from main at commit c0b76369a313 on 2026-09-07T08:24:49.458399685+00:00.
Other public repositories with an OctoCounts report, ranked by top language and code size similarity: