Closed RunDevelopment closed 5 months ago
Getting padding right turned out to be more interesting than I thought. The issue is that torch.nn.functional.pad(t, (0, pad_w, 0, pad_h), "reflect")
only works if pad_w
and pad_h
are less than the width and height of the image respectively. So we first have to pad as much as we can with reflect
and then use something else to cover the rest (if anything). Surprisingly non-trivial.
Changes:
get_padding
forSizeRequirements
. This method will return the necessary to make a size satisfy the requirements.