# google/tangent

Source-to-Source Debuggable Derivatives in Pure Python

Repository: https://github.com/google/tangent
Canonical: https://ross.abutalabs.com/products/tangent
Language: Python
License: Apache-2.0
License Family: permissive
Topics: autodiff, automatic-differentiation, machine-learning, deep-learning
Archived: true
Last push: 2022-09-29T08:17:36+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3233, "days_push": 1434, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2328, forks 432 (observed 2026-08-28T04:06:37.528937+00:00)

## What it is
Tangent is a Python library for automatic differentiation that works by source-to-source transformation: it reads your Python function's source code, transforms its AST, and emits readable Python derivative code. It is compatible with TensorFlow Eager and NumPy and is aimed at researchers and students who want to inspect and debug generated gradient code.

## Use cases
- compute gradients of Python functions with readable generated code
- debug automatic differentiation output step by step
- learn how automatic differentiation works by reading derivative code
- differentiate NumPy and TensorFlow Eager code ahead of time
- generate derivative source code for research experiments

## When to choose
- you need to read, inspect, or debug the generated derivative code
- you want ahead-of-time autodiff on plain Python source
- you're teaching or studying how gradients are computed

## When to avoid
- you need production-grade, actively maintained autodiff - use PyTorch, JAX, or TensorFlow
- you need full Python language coverage or high performance
- you can't tolerate experimental APIs and possible breaking changes

## Facets
- artifact type: library
- maturity: experimental
- function: machine-learning, compiler, parser, developer-tools
- domain: machine-learning, deep-learning, compilers
- platform: python, cross-platform
- tags: automatic-differentiation, autodiff, source-to-source, source-code-transformation, gradients, debuggable, tensorflow, numpy, algorithms

## Member repositories
- google/tangent (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.528937+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:38:13.007247+00:00, confidence not recorded.
  - readme: https://github.com/google/tangent (fetched 2026-08-28T04:06:37.528937+00:00, sha af22ed6799cd)
  - registry_pypi: https://pypi.org/pypi/tangent/json (fetched 2026-08-29T10:18:36.626283+00:00, sha fd2628b8b0e2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
