It’s very close.
The guide talks about the final image, which is the outcome of padding to both “before” and “after”. Then, it is equal to add “2*pad”.
If you add “2*pad” to both “before” and “after”, then, in total, you are adding 4*pad. That’s the reason for this error.
Oh okey got it. It works now but I’m not sure if I understood well.
When we talk about before and after, it refer to what exactly ?
I thought it was at the beginning we want to go from shape “before” to shape “after”.
Number of values padded to the edges of each axis. ((before_1, after_1), … (before_N, after_N)) unique pad widths for each axis. ((before, after),) yields same before and after pad for each axis. (pad,) or int is a shortcut for before = after = pad width for all axes.