       id_point = 0;
       for (int y = yi_t; y <= yi_b; ++y) {
         if (!between(y, 0, height-1)) continue;
-        for (int x = xi_l; x <= xi_r; +=x) {
+        for (int x = xi_l; x <= xi_r; ++x) {
           if (!between(x, 0, width-1)) continue;
           int address = inputImages_strideBatch * b + inputImages_strideHeight * y + inputImages_strideWidth * x + t;
           v += weights[id_point] * inputImages_data[address];

   int id_point = 0;
   for (int y = yi_t; y <= yi_b; ++y) {
     if (!between(y, 0, height-1)) continue;
     for (int x = xi_l; x <= xi_r; +=x) {
       if (!between(x, 0, width-1)) continue;
       float weight = __expf((x - xf) * (x - xf) + (y - yf) * (y - yf));
       weight_sum += weight;

     }
   }
   m /= weight_sum;

   float v=0;
   bool topLeftIsIn = between(xi_l, 0, width-1) && between(yi_t, 0, height-1);
   bool topRightIsIn = between(xi_r, 0, width-1) && between(yi_t, 0, height-1);
