Conv Shape Calculator
Track tensor shapes through stacked Conv2D, MaxPool and AvgPool layers.
How it works
Each layer slides a window (the kernel) across the input. The output size along one spatial dimension is:
in: input height or width,k: kernel size,s: stride,p: padding on each side,d: dilation.- Height and width are computed independently, then rounded down: leftover pixels that don’t fill a full window are dropped.
- Conv2D sets the channel count to
out channels. MaxPool and AvgPool keep the channels unchanged. - Dilation inserts gaps in the kernel, making its effective size
d·(k−1)+1. AvgPool has no dilation in PyTorch. - For pooling, PyTorch uses
stride = kernelby default, so set the stride yourself if you rely on that. - If the effective kernel is larger than the padded input, the output would be empty and the tool reports an error instead of a shape.
Related tools
CSV / JSON Viewer
View, sort, filter and convert CSV and JSON files in your browser. Your data never leaves your device.
Group Project Splitter
Share tasks fairly: balance effort across members, reassign by hand, and export a Markdown checklist.
Harvard Reference Generator
Build Harvard-style references for books, articles, websites, papers and reports, with a sortable reference list.