From 3a7d3393db16b5a17f82e3846f2fca8dd3a7e2ab Mon Sep 17 00:00:00 2001 From: Raman Shariati <91044296+raman1383@users.noreply.github.com> Date: Mon, 26 Dec 2022 15:14:41 +0330 Subject: [PATCH] Update p004-Batches-Layers.c --- C/p004-Batches-Layers.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C/p004-Batches-Layers.c b/C/p004-Batches-Layers.c index 8a7b345..7724bfa 100644 --- a/C/p004-Batches-Layers.c +++ b/C/p004-Batches-Layers.c @@ -83,17 +83,17 @@ void layer_init(layer_dense_t *layer,int intput_size,int output_size){ layer->output_size = output_size; //create data as a flat 1-D dataset - layer->weights = malloc(sizeof(double) * intput_size * output_size); + layer->weights =(double *) malloc(sizeof(double) * intput_size * output_size); if(layer->weights == NULL){ printf("weights mem error\n"); return; } - layer->biase = malloc(sizeof(double) * output_size); + layer->biase = (double *)malloc(sizeof(double) * output_size); if(layer->biase == NULL){ printf("biase mem error\n"); return; } - layer->output = malloc(sizeof(double) * output_size); + layer->output = (double *)malloc(sizeof(double) * output_size); if(layer->output == NULL){ printf("output mem error\n"); @@ -117,7 +117,7 @@ void deloc_layer(layer_dense_t *layer){ if(layer->biase != NULL){ free(layer->biase); } - if(layer->biase != NULL){ + if(layer->output != NULL){ free(layer->output); } } @@ -255,4 +255,4 @@ int main(){ } } -*/ \ No newline at end of file +*/