self.build()
def build(self):
self.padding_module = ReflectionPad2d(self.pad_size)
def __call__(self, x):
if not self.pre_pad:
x = self.padding_module(x)
After Change
// This allow to handle the case where the padding is equal to the image size
if pad_size_tmp[0] == self.input_size[0]:
pad_size_tmp[0] -= 1
pad_size_tmp[1] -= 1
if pad_size_tmp[2] == self.input_size[1]:
pad_size_tmp[2] -= 1
pad_size_tmp[3] -= 1