--- id: torchinfo version: "1.8.0" license: MIT license_treatment: permissive maintenance: active --- # torchinfo — Model summary in PyTorch, based off of the original torchsummary. License: permissive · Maintenance: active · Downloads: 653.1K/mo ## What it is and what it does Torchinfo is a PyTorch utility that generates human-readable summaries of neural network models. It displays layer-by-layer information including input and output shapes, parameter counts, and multiply-accumulate operations (Mult-Adds), helping developers understand and debug their model architectures. Unlike the basic print(model) output, torchinfo provides a structured, Keras-like summary view. The package accepts either input tensor shapes or actual input data, performs a forward pass through the model to gather statistics, and returns a ModelStatistics object with configurable output columns. It supports RNNs, LSTMs, branching architectures, and nested layers, with options for verbose mode, custom display widths, and Jupyter Notebook integration. Use it for: - Debug neural network architecture by viewing layer-by-layer shapes and parameter counts during model development - Estimate model memory footprint and computational cost before training on expensive hardware - Document model structure for papers or reports by capturing formatted summary output - Verify that model layers are connected correctly and data flows as expected through the network - Compare parameter efficiency across different model designs or architectures ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates detailed summaries of PyTorch neural network models, showing layer names, input/output shapes, parameter counts, and computational operations—similar to Keras's model.summary() API. Yes. Torchinfo is a lightweight, actively maintained debugging tool with no dependencies, permissive licensing, and broad PyTorch version support. Install it if you develop or analyze PyTorch models and want structured visibility into layer structure and computational cost. ## Install pip install torchinfo uv add torchinfo poetry add torchinfo ## Installing torchinfo Before you install: Low friction: pure Python wheel with no runtime dependencies. Active maintenance with recent commits and 2946 GitHub stars. Last release was over a year ago, but the repository remains actively maintained. License in practice: MIT license is permissive; you can use, modify, and distribute torchinfo freely in commercial and private projects with minimal restrictions. Quickstart: pip install torchinfo from torchinfo import summary model = ConvNet() summary(model, input_size=(16, 1, 28, 28)) Requires PyTorch 1.4.0 or later; model must be instantiated before calling summary(). Verify before relying: - Whether the package works correctly with PyTorch versions newer than the latest release date (2023-05-14) - Performance characteristics when summarizing very large or deeply nested models ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 653.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytorch model summary, inspect neural network layers, pytorch model visualization, layer parameter analysis, model architecture debugging, pytorch model statistics, network complexity analysis, pytorch-debugging, model-inspection, deep-learning-tools [View on SkillFed](https://skillfed.io/packages/torchinfo) · [View on PyPI](https://pypi.org/project/torchinfo/)