skillfed

torchsummary

Model summary in PyTorch similar to `model.summary()` in Keras

torchsummary v1.5.1 101.5K downloads/30d#12,930 on PyPI4,054
License unclear DORMANT released

What it is and what it does

torchsummary provides a quick way to inspect neural network models by printing a formatted table of layers, output shapes, and parameter counts—similar to Keras's built-in `model.summary()` method. It works by running a forward pass through the network with dummy input of the specified size and capturing layer information along the way.

The package has no runtime dependencies and installs easily, but it is no longer actively maintained. The original author's description explicitly directs users to torchinfo as a newer, updated alternative. Use torchsummary only if you are working with legacy code or have a specific reason to avoid migrating.

Use it for:

  • Quickly inspect the architecture of a custom neural network during development and debugging.
  • Estimate total model size in parameters and memory footprint before training or deployment.
  • Verify that layer output shapes match expectations when designing a new network.
  • Document model structure in notebooks or reports with a clean, readable summary table.
  • Check parameter counts across different model variants to compare complexity.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Displays a Keras-style summary of PyTorch neural network models, showing layer types, output shapes, and parameter counts without requiring manual inspection of the model structure.

No—the package is dormant and its own documentation recommends torchinfo as the maintained successor. Install torchsummary only if you are maintaining legacy code that already depends on it; for new projects, use torchinfo instead.

Install

torchsummary on PyPI

pip

pip install torchsummary

uv

uv add torchsummary

poetry

poetry add torchsummary

Installing torchsummary

Before you install

Installation is frictionless with no runtime dependencies. However, the package is dormant—last release was 2018-09-26 and last commit 2024-03-02—so it receives no active maintenance. The description itself recommends migrating to torchinfo.

License in practice

License treatment is unclear; the description mentions MIT licensing but the metadata lacks formal SPDX declaration. Verify the actual license terms in the repository before relying on it in proprietary or license-sensitive contexts.

Quickstart

pip install torchsummary

from torchsummary import summary
summary(your_model, input_size=(channels, H, W))

Requires a forward pass through the model; input_size parameter must match the expected tensor dimensions for the model's input.

Verify before relying

  • Compatibility with recent PyTorch versions—last release predates many breaking changes in the PyTorch API.
  • Whether torchinfo is a direct drop-in replacement or requires code changes for existing torchsummary users.
  • Current state of maintenance and whether the archived repository flag affects long-term usability.

Package facts

License not declared (unclear)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 2,879 days since the last release
Last repo commit
First released
Downloads 101,495/month — #12,930 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: torchsummary-1.5.1-py3-none-any.whl

Tags

pytorch model summarykeras style model.summary pytorchneural network layer visualizationpytorch model architecture inspectionparameter count pytorchmodel size estimation pytorchpytorch network debugging
model-inspectiondeprecated

More Artificial Intelligence packages