How to make maxpooling use "floor"?

The output size of maxpooling of pytorch is obtained by rounding down. When I convert a pytorch model to caffe model, I recompile the caffe source code and let its maxpooling use floor, Caffe’s maxpooling defaults to use ceil. When I convert the converted caffe model to tensorrt, maxpooling in tensorrt seems to use ceil. How should I do that the maxpooling of tensorrt use floor?


Caffe parser by default uses ceil for max pooling during caffe -> TRT conversion.
I would recommend you to create custom plugin to use floor for maxpooling and use that plugin while converting your caffe model to tensorrt.