#221221st of 433 in ML frameworks and libraries
torchinfo
Keras-style model.summary() for PyTorch modules, with shapes, params and mult-adds
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 torchinfo on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.torchinfo is on your watch list. Its new releases and problems show there.
- Stars
- 3k
- License
- MIT
- Last commit
- Nov 2026
- Last release
- May 2023
- Language
- Python
2,906 on 2 May 20262,950 on 28 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
torchinfo prints a layer-by-layer table for a PyTorch nn.Module: input and output shapes, parameter counts, kernel size, trainable flag and mult-adds, plus estimated memory size. It runs a forward pass from either an input shape or real input data, and returns a ModelStatistics object. It is a rewrite of torchsummary and torchsummaryX, installable from PyPI or conda-forge.
Who it is for: PyTorch developers inspecting and debugging model architectures
Strengths
- Takes an input shape or real input data, including dicts and multiple inputs with different dtypes
- Configurable columns, nesting depth and row settings; handles RNNs, LSTMs, Sequential and ModuleList
- Returns a ModelStatistics object, so summary data can be used as a string or in code
- Works in Jupyter and Colab; installs with pip or conda
Weaknesses
- Needs a forward pass to show shapes and mult-adds; without input only layer names and params appear
- Mixed train/eval layers can alter batchnorm or dropout statistics during the summary
- cache_forward_pass does not detect model or input changes and can give stale summaries
- Last release was 2023-05-14; older versions get no backported fixes
What it needs
- GPU optional
- Needs PyTorch
- Models: PyTorch nn.Module
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 ML frameworks and libraries
See all 433| Rank | Project | Score |
|---|---|---|
| #219 | deepgemmCUDA tensor core kernels for FP8, FP4 and BF16 GEMMs and fused MoE | 54 out of 100 |
| #220 | object-detection-metricsPython functions for computing object detection metrics like PASCAL VOC AP | 54 out of 100 |
| #222 | quantumPython library for hybrid quantum-classical ML on TensorFlow and Cirq | 54 out of 100 |
| #223 | nncfQuantization and compression toolkit for OpenVINO, PyTorch and ONNX models | 54 out of 100 |
| #224 | torch-fidelityPyTorch library for computing generative model metrics like FID, KID and ISC | 54 out of 100 |