PyTorch to CoreML: Writing custom layers with Metal
cd Convert
python3 -m pip install -r requirements.txt
python3 convert.py -o /path/to/output/resulting/mlmodel/file
Open TorchCoreMLDemo.xcodeproj
in Xcode, build and run the app.
The code of the grid sample Metal-shader is here.
More information about grid sample (warper) algorithm you can find here.