       yf = gridData[threadIdx.y*2];
       xf = gridData[threadIdx.y*2+1];
 
-
-
       int yInTopLeft, xInTopLeft;
       float yWeightTopLeft, xWeightTopLeft;
       getTopLeft(xf, inputImages_width, xInTopLeft, xWeightTopLeft);

      float inBottomLeftMask=0;
      float inBottomRightMask=0;

      if(topLeftIsIn) inTopLeftMask = masks_data[inTopLeftAddress];
      if(topRightIsIn) inTopRightMask = masks_data[inTopRightAddress];
      if(bottomLeftIsIn) inBottomLeftMask = masks_data[inBottomLeftAddress];
      if(bottomRightIsIn) inBottomRightMask = masks_data[inBottomRightAddress];

      m = xWeightTopLeft * yWeightTopLeft * inTopLeftMask
        + (1 - xWeightTopLeft) * yWeightTopLeft * inTopRightMask

      const int gradInputImagesTopRightAddress = gradInputImagesTopLeftAddress + gradInputImages_strideWidth;
      const int gradInputImagesBottomLeftAddress = gradInputImagesTopLeftAddress + gradInputImages_strideHeight;
      const int gradInputImagesBottomRightAddress = gradInputImagesBottomLeftAddress + gradInputImages_strideWidth;

      const int inTopLeftMaskAddress = masks_strideBatch * b + masks_strideHeight * yInTopLeft + masks_strideWidth * xInTopLeft;
      const int inTopRightMaskAddress = inTopLeftMaskAddress + masks_strideWidth;
      const int inBottomLeftMaskAddress = inTopLeftMaskAddress + masks_strideHeight;
      const int inBottomRightMaskAddress = inBottomLeftMaskAddress + masks_strideWidth;

      const int gradMasksTopLeftAddress = gradMasks_strideBatch * b + gradMasks_strideHeight * yInTopLeft + gradMasks_strideWidth * xInTopLeft;
      const int gradMasksTopRightAddress = gradMasksTopLeftAddress + gradMasks_strideWidth;
      const int gradMasksBottomLeftAddress = gradMasksTopLeftAddress + gradMasks_strideHeight;
      const int gradMasksBottomRightAddress = gradMasksBottomLeftAddress + gradMasks_strideWidth;

      const int gradOutputAddress = gradOutput_strideBatch * b + gradOutput_strideHeight * yOut + gradOutput_strideWidth * xOut;

