Someone appears to have implemented it here:

  
      github.com
  
  
    zcaceres/spec_augment/blob/77335b74efc453c6bcd589357e8365ddcb7688aa/exp/nb_SparseImageWarp.py 123

#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/SparseImageWarp.ipynb

import torch
import numpy as np

def sparse_image_warp(img_tensor,
                      source_control_point_locations,
                      dest_control_point_locations,
                      interpolation_order=2,
                      regularization_weight=0.0,
                      num_boundaries_points=0):
    control_point_flows = (dest_control_point_locations - source_control_point_locations)

#     clamp_boundaries = num_boundary_points > 0
#     boundary_points_per_edge = num_boundary_points - 1
    batch_size, image_height, image_width = img_tensor.shape


  This file has been truncated. show original

  
  
    
    
  
  


See also:

  
      github.com
  
  
    zcaceres/spec_augment/blob/77335b74efc453c6bcd589357e8365ddcb7688aa/SparseImageWarp.ipynb 31
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TensorFlow's `sparse_image_warp` in Pytorch"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [],
   "source": [
    "# first call `%store spectro` in the other notebook to save spectro value here\n",
    "%store -r spectro"
   ]
  },
  {


  This file has been truncated. show original