Check this for the roi pooling of pytorch way: https://github.com/ruotianluo/pytorch-faster-rcnn/commit/fa88df8c66528afc33cf8f900649504ebbc0335e#diff-69a3170ac05571b54972ad6d8ab782ddL125 93
This repo used F.grid_sample at the first and changed to my crop_and_resize in this commit. Then the newest one used roi_align from facebookresearch/maskrcnn-benchmark 59