Every normalisation layer does the same arithmetic — subtract a mean, divide by a standard deviation, then rescale with γ and β. The only thing that changes between BatchNorm, LayerNorm, InstanceNorm and GroupNorm is which numbers get pooled into one mean. Hover any cell: everything outside its pooling group is greyed out, and the maths is written underneath. At the bottom, the problem it was invented for — the input distribution moving under a layer while it trains.
Start with one neuron and seven steps: the forward pass runs left to right along the top, the backward pass runs right to left directly underneath, one multiplication per step, so every gradient sits below the value it came from. Every number is tinted by its own size — strong when it is large, faded as it approaches zero — and each derivative being multiplied is drawn as a tangent line, flat meaning the gradient dies there. Then give it a hidden layer: the same neuron, many times over, wired into columns. Nothing new happens except that the chain rule grows two factors per layer, so the product above the diagram gets longer and the gradients that reach the first layer get smaller. Drag any wire to change its weight, click a neuron to write its arithmetic out, or press play and watch the fit on the right settle onto the points.
nn.Linear does.