 
     int ncols_u = ncols*k;
     int ncols_x = (k == 3) ? ncols : ncols_u;
-    const scalar_t mask = (mask_c == NULL) ? 1.0 : (*(mask_c + col));
+    const scalar_t mask = (mask_c == NULL) ? (scalar_t)1.0 : (*(mask_c + col));
     scalar_t gwc1 = 0;
     scalar_t gwc2 = 0;
     scalar_t gbias1 = 0;

    const auto wc2 = *(weight_c + (col%d) + d);
    const auto bias1 = *(bias + (col%d));
    const auto bias2 = *(bias + (col%d) + d);
    const auto mask = (mask_c == NULL) ? 1.0 : (*(mask_c + col));
    scalar_t gwc1 = 0;
    scalar_t gwc2 = 0;
    scalar_t gbias1 = 0;

    const int total = batch_size * hidden_size * 2;
    const dim3 blocks( (total - 1) / threads + 1 );

    AT_DISPATCH_FLOATING_TYPES_AND_HALF(U.type(), "sru_bi_forward_cuda", ([&] {
        cuda_bi_forward_kernel<scalar_t><<<blocks, threads>>>(
            h.data<scalar_t>(),
            c.data<scalar_t>(),
