ceil_mode=True for unfold

I’m using nn.Unfold to implementing a custom pooling layer, however, I’d like to keep the last value, like what ceil_mode=True for MaxPool would do. It seems that Unfold does not support this, is there a workaround?

You could pad the input to create the desired output shape.