Open-Source Wikis

/

TensorFlow

/

By the numbers

tensorflow/tensorflow

By the numbers

A quantitative snapshot of the tensorflow/tensorflow repo. Data collected on 2026-04-30 from master at commit c6c20a596bb.

Size

The repo is dominated by C++ (kernels, runtime, compiler) and Python (frontend), with smaller Bazel, protobuf, and mobile-language footprints.

xychart-beta horizontal
  title "Lines of code by language (top-level tensorflow/ directory)"
  x-axis ["Bazel BUILD/.bzl", "Java", "Protobuf", "Python", "C/C++ headers", "C/C++ source"]
  y-axis "Lines" 0 --> 2100000
  bar [53335, 80000, 120000, 1203668, 552503, 2028098]
Language Files (approx.) Lines (approx.)
C/C++ source (.cc) 10 589 2 028 098
C/C++ header (.h) 6 321 552 503
Python (.py) 3 153 1 203 668
Bazel (BUILD/.bzl) 354 .bzl + many BUILDs 53 335
Protobuf (.proto) 340 ~120 000
Java 179 ~80 000
Mobile (.mm/.m/.swift) 98 smaller

Test files: ~3 303 files matching *_test.cc or *_test.py under tensorflow/.

Top-level source directories by approximate footprint:

Directory Role
tensorflow/core/kernels/ ~10 000 C++ kernels — easily the heaviest single subdirectory
tensorflow/python/ Python frontend, including keras/ (legacy), ops/, data/, eager/, distribute/
tensorflow/lite/ Mobile/embedded interpreter, kernels, delegates, converter
tensorflow/compiler/ XLA bridge, JIT, AOT, MLIR, TensorRT
tensorflow/core/ Framework + runtime + grappler + distributed + tfrt
third_party/ Bazel rules and patches for vendored deps

Activity

The repository has had 193 318 commits since the initial commit on 2015-11-06. Approximate annual commit volume:

Year Commits
2015–2016 12 561
2017 13 992
2019 29 016
2022 17 678
2025 14 672

Last 90 days: ~3 449 commits. Last 365 days: ~13 790 commits. The project averages roughly 30+ commits per day on master.

There are 226 release tags in the repository (git tag), spanning v0.5.0 (Nov 2015) through v2.21.0-class major releases.

Bot-attributed commits

A. Unique TensorFlower (gardener@tensorflow.org) is the automated mirroring bot that imports changes from Google's internal monorepo via Copybara — it is not a person. Counts over the last ~16 months:

Author handle Commits since 2024-01-01 Notes
A. Unique TensorFlower 11 832 Internal Google contributions via Copybara
TensorFlower Gardener 507 Older variant of the same bot
dependabot[bot] 145 Dependency bumps

Together those bot identities account for the bulk of master commits. Lower-bound estimate of human-attributed external work in the last 16 months: ~25–30%, since most external PRs land via Copybara and also get re-attributed to "A. Unique TensorFlower" on the squash. This figure is a floor, not a ceiling — many commits authored by Googlers also appear under their own names.

Complexity

A few outsized hot spots:

  • tensorflow/core/kernels/BUILD — 222 935 bytes, the largest single Bazel file in the tree.
  • tensorflow/core/BUILD — 80 429 bytes.
  • tensorflow/python/BUILD — 73 469 bytes.
  • tensorflow/core/kernels/maxpooling_op.cc — 78 170 bytes (single file).
  • tensorflow/python/keras/backend.py — 205 953 bytes (the largest pure-Python file in the bundled Keras snapshot).
  • tensorflow/python/keras/metrics.py — 129 453 bytes.
  • tensorflow/python/keras/callbacks.py — 110 157 bytes.
  • tensorflow/python/tfe_wrapper.cc — 89 106 bytes.
  • RELEASE.md — 764 574 bytes (one file documenting every release since 0.5.0).

Test-to-code ratio

tensorflow/core/kernels/ has ~3 300 test files alongside ~10 000 source files — roughly 1 test file per 3 source files at the kernel layer. The Python tree is similar (tensorflow/python/kernel_tests/ is a top-level test directory of its own).

Dependencies

Pip dependencies are pinned per Python version:

  • requirements_lock_3_10.txt (~70 KB)
  • requirements_lock_3_11.txt, _3_12, _3_13, _3_14

External Bazel dependencies live under third_party/. Notable vendored projects: xla (the XLA compiler split into its own repo), Eigen, Protobuf, gRPC, Abseil, ICU, MKL, ml_dtypes, ruy, FlatBuffers, NCCL, TensorRT (header-only). See reference/dependencies.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – TensorFlow wiki | Factory