# sksq96/pytorch-summary

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sksq96-pytorch-summary).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

4,054 stars · 410 forks · Python · MIT

## Links

- GitHub: https://github.com/sksq96/pytorch-summary
- awesome-repositories: https://awesome-repositories.com/repository/sksq96-pytorch-summary.md

## Topics

`deep-learning` `keras` `pytorch` `summary`

## Description

pytorch-summary is a collection of utilities for PyTorch neural networks designed to generate model summaries, calculate memory requirements, and visualize layer-by-layer tensor shapes. It functions as a reporting tool that provides detailed breakdowns of network layers and output shapes to assist with model debugging and inspection.

The project provides specialized capabilities for estimating the total memory usage of forward and backward passes based on input dimensions and parameter counts. It generates human-readable visualizations of model structures to verify architectural designs and identify dimension mismatches across layers.

The tool implements structural analysis through recursive module traversal, hook-based tensor tracking, and input-driven shape inference. These capabilities allow for the aggregation of parameter counts and the mapping of data flow between successive operations.

## Tags

### Artificial Intelligence & ML

- [Architecture Visualizers](https://awesome-repositories.com/f/artificial-intelligence-ml/deep-learning-architectures/architecture-visualizers.md) — A reporting tool that generates detailed breakdowns of network layers and tensor shapes for model debugging.
- [Model Summary Visualizers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-summary-visualizers.md) — Generates human-readable summaries of PyTorch model structures similar to the Keras summary format.
- [Tensor Shape Inferences](https://awesome-repositories.com/f/artificial-intelligence-ml/dynamic-tensor-shapes/tensor-shape-inferences.md) — Determines output dimensions by passing dummy tensors through the network to trigger actual layer computations.
- [Runtime Shape Tracking](https://awesome-repositories.com/f/artificial-intelligence-ml/dynamic-tensor-shapes/tensor-shape-inferences/runtime-shape-tracking.md) — Intercepts PyTorch forward passes using hooks to record the exact shape of tensors at every layer.
- [Model Parameter Aggregators](https://awesome-repositories.com/f/artificial-intelligence-ml/model-parameter-aggregators.md) — Sums the elements of all registered model weights to calculate the total size of the neural network.
- [Neural Network Debugging](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-debugging.md) — Checks for dimension mismatches and tensor shape errors across multiple layers within a PyTorch model.
- [Model Architecture Inspection](https://awesome-repositories.com/f/artificial-intelligence-ml/pytorch-model-components/model-architecture-inspection.md) — Analyzes the architecture and layer-by-layer output shapes of PyTorch neural networks to verify model design.
- [Model Summary Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/pytorch-model-development/model-summary-tools.md) — A utility for visualizing layer architecture, output shapes, and parameter counts for PyTorch neural networks.
- [Recursive Module Operations](https://awesome-repositories.com/f/artificial-intelligence-ml/recursive-module-operations.md) — Iterates through the nested hierarchy of PyTorch modules to aggregate parameter counts and layer metadata.
- [Tensor Data Flow Mapping](https://awesome-repositories.com/f/artificial-intelligence-ml/tensor-data-flow-mapping.md) — Maps the flow of data and resulting tensor shapes between successive neural network layers.
- [Model Architecture Visualizations](https://awesome-repositories.com/f/artificial-intelligence-ml/model-architecture-visualizations.md) — Generates detailed reports of network layers, output shapes, and parameter counts for specified input tensors. ([source](https://github.com/sksq96/pytorch-summary#readme))

### DevOps & Infrastructure

- [Memory Capacity Estimators](https://awesome-repositories.com/f/devops-infrastructure/infrastructure-requirements/memory-capacity-estimators.md) — Calculates the memory footprint of each operation based on the size of input and output tensors.
- [Pass-Based Memory Estimation](https://awesome-repositories.com/f/devops-infrastructure/infrastructure-requirements/memory-capacity-estimators/pass-based-memory-estimation.md) — Calculates the total memory and parameter counts required for PyTorch models during forward and backward passes.

### Part of an Awesome List

- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — Model summary utility.
- [Training and Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/training-and-utilities.md) — Model summary utility similar to Keras.
