CNN layer shape & parameter calculator. Exact PyTorch arithmetic, fp32, in your browser.
No layers yet. Add one below or pick a preset.
H_out = floor((H + 2p − d·(k−1) − 1) / s + 1), with ceil for pooling when ceil_mode=True (and the last window must start inside the input or left padding). Same for W.out · (in / groups) · kh · kw (+ out if bias)2 · C trainable (weight, bias). running_mean, running_var and num_batches_tracked are buffers, not counted.in · out (+ out if bias). Needs a 1D input: put a Flatten after the last 4D layer.H + 2p − d·(k−1) − 1 is not divisible by the stride, PyTorch floors silently and drops the last rows/columns. Shown as a warning; shape propagation continues. Errors stop it.Kernel, stride, padding and dilation take n or h,w (a dot also works as separator, for phone keypads). Pool stride left empty means stride = kernel_size. The model is stored in the URL, so links reproduce it.