Conv Shape Calculator
Track tensor shapes through stacked Conv2D, MaxPool and AvgPool layers.
NeweasyRuns in your browser
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
AI / MLNew
LLM VRAM Estimator
Estimate GPU memory to run or fine-tune an LLM, and see which GPUs it fits on.
AI / MLNew
LR Schedule Visualiser
Plot learning-rate schedules (cosine, warmup, step, one-cycle…) and overlay up to three.
AI / MLNew
Metrics Calculator
Accuracy, precision, recall, F1 and specificity from a confusion matrix, with macro and micro averages.