     const scalar_t mask = (mask_c == NULL) ? (scalar_t)1.f : (*(mask_c + col));
     auto cur = *(init + col);
     const int d2 = d*2;
-    if (is_custom){
-        const auto* vp = weight_c + (col*2);
-    }
-    else{
-        const auto wc1 = *(weight_c + (col%d2));
-        const auto wc2 = *(weight_c + (col%d2) + d2);
+
+    auto* vp;
+    auto wc1;
+    auto wc2;
+    if (is_custom) {
+        vp = weight_c + (col*2);
+    }
+    else {
+        wc1 = *(weight_c + (col%d));
+        wc2 = *(weight_c + (col%d) + d);
     }
     const auto bias1 = *(bias + (col%d2));
     const auto bias2 = *(bias + (col%d2) + d2);

    const int ncols_u = ncols*k;
    const int ncols_x = (k == 3) ? ncols : ncols_u;

    if (is_custom){
        const auto* vp = weight_c + (col*2);
    }
    else{
        const auto wc1 = *(weight_c + (col%d));
        const auto wc2 = *(weight_c + (col%d) + d);
    }

    const auto bias1 = *(bias + (col%d));

    scalar_t gbias2 = 0;
    auto cur = *(grad_last + col);
    const int d2 = d*2;

    auto* vp;
    auto wc1;
    auto wc2;
    if (is_custom) {
        vp = weight_c + (col*2);
    }
    else {
        wc1 = *(weight_c + (col%d));
        wc2 = *(weight_c + (col%d) + d);
    }

    const auto bias1 = *(bias + (col%d2));
    const auto bias2 = *(bias + (col%d2) + d2);

