Include dilation before counting windows
shape▲▲△Exact integers and fractions where possible; six decimals otherwise.
STATEMENT
Audit an entire batched convolution without relying on a framework’s inferred shape.
GIVEN
Input layout is . There are four output channels, a by kernel, dilation two, stride two and padding one on every side. Use one group and a trainable output-channel bias.
FIND
Effective kernel span, output shape, weight shape, parameter count and main-product multiply-accumulates.
STRATEGY
Use (I.11.4) on each spatial axis, then (I.11.2) on the resulting grid. Dilation spreads taps; it does not create additional weights.
SOLUTION
The effective kernel width is on both axes. Therefore
The output shape is . The weight shape is and bias shape is . There are parameters.
Each output scalar uses weights. There are output scalars, giving multiply-accumulates. This dense accounting includes multiplications by padded zero entries; a specialised implementation may skip some.
Answer
Span by , output , 112 parameters and 1944 main-product multiply-accumulates.
Check — sanity
Ignoring dilation would give spatial outputs by , a different model. The number of weights would not change, which is why a parameter-count check alone cannot catch that shape error.
Where this breaks
The weight layout here is output-channel, input-channel, height, width. A channels-last input convention changes array organisation, not the mathematical count. Named ‘same’ padding need not mean one pixel on each side.
Variation
Keep the input and kernel but set dilation to one. The output becomes , with multiply-accumulates and still 112 parameters.