Has been tested in pytorch=2.11.0, python=3.13, CUDA=12.8
export CUDA_HOME=/usr/local/cuda #use your CUDA instead
chmod a+x install.sh
./install.shcd test
python test.pyfrom Forward_Warp import forward_warp
fw = forward_warp()
# default interpolation mode is Bilinear
im2_bilinear = fw(im0, flow)
# use interpolation mode Nearest
# Notice: Nearest input-flow's gradient will be zero when at backward.
im2_nearest = fw(im0, flow, interpolation_mode="Nearest")