 
     std::cout << "num_out_neurons_last " << num_out_neurons_last_layer << std::endl;
 
-    float_type* coeffs = fp->layers[layerno]->coeffs;
-    float_type* csts = fp->layers[layerno]->csts;
+    float_type* coeffs;
+    float_type* csts;
+
+    if(fp->layers[layerno]->type == CONV)
+    {
+        cudaMalloc((void**) &coeffs, num_out_neurons_last_layer*num_in_neurons_last_layer*sizeof(float_type));
+        cudaMalloc((void**) &csts, num_out_neurons_last_layer*sizeof(float_type));
+
+        sparse_to_dense(fp->layers[layerno], coeffs, csts);
+    }
+    else
+    {
+        coeffs = fp->layers[layerno]->coeffs;
+        csts = fp->layers[layerno]->csts;
+    }
 
     float_type* lb_array = fp->layers[layerno]->lb_array;
     float_type* ub_array = fp->layers[layerno]->ub_array;

        cudaFree(lsup_coeff_tmp);
        cudaFree(uinf_coeff_tmp);
        cudaFree(usup_coeff_tmp);
    }

    compute_lb_from_expr<<<num_out_neurons_last_layer, 1>>>(lb_array, linf_coeff, lsup_coeff, linf_cst, fp->input_inf, fp->input_sup, num_out_neurons_last_layer, num_in_neurons_first_layer);


    layer_create_sparse_exprs(fp, filter_weights, filter_bias, input_size, filter_size, num_filters, strides, is_valid_padding, has_bias);

    float_type* coeffs_tmp;
    float_type* csts_tmp;

    cudaMalloc((void**) &coeffs_tmp, fp->layers[0]->num_out_neurons*fp->layers[0]->num_in_neurons*sizeof(float_type));
    cudaMalloc((void**) &csts_tmp, fp->layers[0]->num_out_neurons*sizeof(float_type));

    sparse_to_dense(fp->layers[0], coeffs_tmp, csts_tmp);

    layer_compute_bounds_from_exprs<<<fp->layers[0]->num_out_neurons, 1>>>(coeffs_tmp, csts_tmp, fp->layers[0]->lb_array, fp->layers[0]->ub_array, fp->input_inf, fp->input_sup, fp->layers[0]->num_out_neurons, fp->layers[0]->num_in_neurons);

    cudaFree(coeffs_tmp);
    cudaFree(csts_tmp);
}


