Add channels-last support for bilinear and nearest 2d interpolation on CUDA (#56322)
Summary:
Add channels-last support for bilinear and nearest 2d interpolation on CUDA
Benchmark (on 2070 Super) is available at
- nearest 2d: https://github.com/xwang233/code-snippet/tree/master/interpolate-channels-last/nearest-2d
- bilinear: https://github.com/xwang233/code-snippet/tree/master/interpolate-channels-last/bilinear
Some regressions are seen for tensors with small channel size. We may add a heuristic to dispatch the contiguous and channels-last path if needed.
Close https://github.com/pytorch/pytorch/issues/60137
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56322
Reviewed By: mruberry
Differential Revision: D29645980
Pulled By: ngimel
fbshipit-source-id: c36dff4ee4789bec9b01da4029f326d30067c6b7