# Swall0w/torchstat

Model analyzer in PyTorch

Repository: https://github.com/Swall0w/torchstat
Canonical: https://ross.abutalabs.com/products/torchstat
Language: Python
License: MIT
License Family: permissive
Topics: pytorch, python
Last push: 2023-03-19T03:13:59+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2868, "days_push": 1263, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1500, forks 138 (observed 2026-08-28T04:04:54.176279+00:00)

## What it is
torchstat is a lightweight neural network analyzer for PyTorch that reports parameter counts, FLOPs, multiply-adds, and memory usage per layer. It can be used as a CLI tool or imported as a Python module to profile nn.Module models.

## Use cases
- count total parameters in a PyTorch model
- estimate FLOPs and multiply-adds of a neural network
- measure memory usage of model layers
- profile layer-by-layer compute cost of a network
- debug PyTorch model architecture statistics

## When to choose
- you need quick parameter/FLOPs/memory stats for a PyTorch nn.Module
- you want a simple CLI or one-line stat() call for model analysis

## When to avoid
- you need support for ops like Dropout2d or newer PyTorch modules
- you need actively maintained tooling with modern PyTorch compatibility
- you need runtime profiling rather than theoretical estimates

## Facets
- artifact type: library
- maturity: maintenance
- function: benchmarking, developer-tools, cli
- domain: deep-learning, machine-learning, developer-tools, performance
- platform: python, cli, cross-platform
- tags: pytorch, model-analysis, flops, memory-usage, neural-networks, profiling

## Member repositories
- Swall0w/torchstat (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:54.176279+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-30T04:32:58.912590+00:00, confidence not recorded.
  - readme: https://github.com/Swall0w/torchstat (fetched 2026-08-28T04:04:54.176279+00:00, sha 88a727fbee24)
  - registry_pypi: https://pypi.org/pypi/torchstat/json (fetched 2026-08-29T11:37:54.604041+00:00, sha bd06d78c6628)
- Data as of 2026-08-30T08:39:29.467469+00:00.
