Explaination for Padding= 'same' for convtranspose in the UNET architecture

Yes took me some time, but finally figured it out. Sad that there is no intuitive documentation available for the same

For the people wondering here it is,

The padding == same, basically pads the output to the multiple of the stride and input height/width

IE:
lets take
input size = 8
filter size = 3

for stride == 1

padding == valid
we get 13 as output ( which works out according to formula )

Formula is output_height = filter_height + (input_height - 1) * stride btw
( The height can also be substituted by the width )

but what is stride * input ? 8 * 1 = 8

so when you apply padding == same
the output will be 8

same thing for other strides

s==2 padding == valid
Output : 20

s==2 padding == same
Output : 16

s==3 padding == valid
Output : 27

s==3 padding == same
Output : 24

basically the idea is you can use use padding == same to make sure the output is a perfect multiple of the input

output = input * stride

Hope this helps some other learner

Once again Thank you Very Much Paul for your super quick and helpful response.
Really appreciate it

Regards,
Shas