--- id: torchsummary version: "1.5.1" license: unclear license_treatment: unclear maintenance: dormant --- # torchsummary — Model summary in PyTorch similar to `model.summary()` in Keras License: unclear · Maintenance: dormant · Downloads: 101.5K/mo ## 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 above — 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 pip install torchsummary uv add torchsummary 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 101.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch model summary, keras style model.summary pytorch, neural network layer visualization, pytorch model architecture inspection, parameter count pytorch, model size estimation pytorch, pytorch network debugging, model-inspection, deprecated [View on SkillFed](https://skillfed.io/packages/torchsummary) · [View on PyPI](https://pypi.org/project/torchsummary/)