code: def th_bilinear_interp2d(input_, coords):
      """
      bilinear interpolation in 2d
      """
      x = th.clamp(coords[:, :, 0], 0, input_.size(1) - 2)
      x0 = x.floor()
      x1 = x0 + 1
      y = th.clamp(coords[:, :, 1], 0, input_.size(2) - 2)
      y0 = y.floor()
      y1 = y0 + 1
  
      stride = th.LongTensor(input_.stride())
      x0_ix = x0.mul(stride[1]).long()
      x1_ix = x1.mul(stride[1]).long()
      y0_ix = y0.mul(stride[2]).long()
      y1_ix = y1.mul(stride[2]).long()
  
      input_flat = input_.view(input_.size(0), -1)
  
      vals_00 = input_flat.gather(1, x0_ix.add(y0_ix))
      vals_10 = input_flat.gather(1, x1_ix.add(y0_ix))
      vals_01 = input_flat.gather(1, x0_ix.add(y1_ix))
      vals_11 = input_flat.gather(1, x1_ix.add(y1_ix))
  
      xd = x - x0
      yd = y - y0
      xm = 1 - xd
      ym = 1 - yd
  
      x_mapped = (
          vals_00.mul(xm).mul(ym)
          + vals_10.mul(xd).mul(ym)
          + vals_01.mul(xm).mul(yd)
          + vals_11.mul(xd).mul(yd)
      )
  
      return x_mapped.view_as(input_)
  
imports: import pickle
  import random
  from .optimizers import *
  from .callbacks import *
  import torch
  from pywick.callbacks import *
label_desc: Use image node_id 14 for calling a global function with example usage: th_bilinear_interp2d(input_, coords) and returns: x_mapped