code: def interpolate_grad_bilinear_gpu(gy, v, u, vw, uw, H, W):
      B, C, out_H, out_W = gy.shape
      gx = cuda.cupy.zeros((B * C, H, W), dtype=gy.dtype)
  
      cuda.elementwise(
          "T gy, S v, S u, T vw, T uw, S H, S W, S outsize",
          "raw T gx",
          """
          // indices
          S v0 = v;
          S v1 = min(v + 1, (S)(H - 1));
          S u0 = u;
          S u1 = min(u + 1, (S)(W - 1));
          // weights
          T w0 = (1 - vw) * (1 - uw);
          T w1 = (1 - vw) * uw;
          T w2 = vw * (1 - uw);
          T w3 = vw * uw;
          // scatter
          S offset = i / outsize * H * W;
          atomicAdd(&gx[offset + v0 * W + u0], w0 * gy);
          atomicAdd(&gx[offset + v0 * W + u1], w1 * gy);
          atomicAdd(&gx[offset + v1 * W + u0], w2 * gy);
          atomicAdd(&gx[offset + v1 * W + u1], w3 * gy);
          """,
          "resize_images_interpolate_grad_bilinear",
      )(gy, v, u, vw, uw, H, W, out_H * out_W, gx)
  
      return gx.reshape((B, C, H, W))
  
imports: from __future__ import division
  import numpy
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 5 for calling a global function with example usage: interpolate_grad_bilinear_gpu(gy, v, u, vw, uw, H, W) and returns: gx