[iOS GPU][MaskRCNN] Implement RoIAlign in Metal shaders using Sampler (#56075)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56075
Inspired by the CUDA implementation - https://fburl.com/diffusion/e90tabkj. The main difference is the way we implement bilinear interpolation. CUDA does this manually by iterating every point in each bin box. Whereas, Metal does this by calling sampler's sample function, which is a bit easier and faster. The result is almost identical to the result from CPU - P365102522.
We'll do another round of refactor once we have figured out how to support custom ops on GPU.
ghstack-source-id: 131720620
Test Plan:
1. Circle CI
2. Sandcastle
Reviewed By: ajtulloch
Differential Revision: D27485068
fbshipit-source-id: 31e831aead9d3799a3fde96e99dd677d96bd3da1