How to warp STL file using flow from STN network?

I have a STN algorithm that generates flow for two 3D image, say the inputs are (1x1x96x96x21), the output flow of STN is (1x3x96x96x21). How do I use to this flow output to warp a decimated .stl mesh file with completely different dimensions using grid_sample?