#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.

Stars
3k
License
MIT
Last commit
Nov 2026
Last release
May 2023
Language
Python
Stars, last 30 weeks+44
2 May 2026: 2,906 stars9 May 2026: 2,915 stars16 May 2026: 2,916 stars23 May 2026: 2,919 stars30 May 2026: 2,919 stars6 Jun 2026: 2,919 stars13 Jun 2026: 2,921 stars20 Jun 2026: 2,922 stars27 Jun 2026: 2,925 stars4 Jul 2026: 2,930 stars11 Jul 2026: 2,932 stars18 Jul 2026: 2,933 stars25 Jul 2026: 2,933 stars1 Aug 2026: 2,935 stars8 Aug 2026: 2,935 stars15 Aug 2026: 2,938 stars22 Aug 2026: 2,939 stars29 Aug 2026: 2,942 stars5 Sept 2026: 2,943 stars12 Sept 2026: 2,944 stars19 Sept 2026: 2,945 stars26 Sept 2026: 2,945 stars3 Oct 2026: 2,945 stars10 Oct 2026: 2,946 stars17 Oct 2026: 2,946 stars24 Oct 2026: 2,946 stars31 Oct 2026: 2,947 stars7 Nov 2026: 2,947 stars14 Nov 2026: 2,948 stars21 Nov 2026: 2,949 stars28 Nov 2026: 2,950 stars

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
Also in ML frameworks and libraries
RankProjectScore
#219deepgemmCUDA tensor core kernels for FP8, FP4 and BF16 GEMMs and fused MoE9.2k starsMIT54 out of 100
#220object-detection-metricsPython functions for computing object detection metrics like PASCAL VOC AP5.1k starsMIT54 out of 100
#222quantumPython library for hybrid quantum-classical ML on TensorFlow and Cirq2.2k starsApache-2.054 out of 100
#223nncfQuantization and compression toolkit for OpenVINO, PyTorch and ONNX models1.2k starsApache-2.054 out of 100
#224torch-fidelityPyTorch library for computing generative model metrics like FID, KID and ISC1.2k starscustom license54 out of 100