mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
improve compatibility with c++ compilers, prepare for CMake
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
layer make_shortcut_layer(int batch, int index, int w, int h, int c, int w2, int h2, int c2)
|
||||
{
|
||||
fprintf(stderr,"Shortcut Layer: %d\n", index);
|
||||
layer l = {0};
|
||||
layer l = { (LAYER_TYPE)0 };
|
||||
l.type = SHORTCUT;
|
||||
l.batch = batch;
|
||||
l.w = w2;
|
||||
@ -21,8 +21,8 @@ layer make_shortcut_layer(int batch, int index, int w, int h, int c, int w2, int
|
||||
|
||||
l.index = index;
|
||||
|
||||
l.delta = calloc(l.outputs*batch, sizeof(float));
|
||||
l.output = calloc(l.outputs*batch, sizeof(float));;
|
||||
l.delta = (float*)calloc(l.outputs * batch, sizeof(float));
|
||||
l.output = (float*)calloc(l.outputs * batch, sizeof(float));
|
||||
|
||||
l.forward = forward_shortcut_layer;
|
||||
l.backward = backward_shortcut_layer;
|
||||
@ -44,8 +44,8 @@ void resize_shortcut_layer(layer *l, int w, int h)
|
||||
l->h = l->out_h = h;
|
||||
l->outputs = w*h*l->out_c;
|
||||
l->inputs = l->outputs;
|
||||
l->delta = realloc(l->delta, l->outputs*l->batch * sizeof(float));
|
||||
l->output = realloc(l->output, l->outputs*l->batch * sizeof(float));
|
||||
l->delta = (float*)realloc(l->delta, l->outputs * l->batch * sizeof(float));
|
||||
l->output = (float*)realloc(l->output, l->outputs * l->batch * sizeof(float));
|
||||
|
||||
#ifdef GPU
|
||||
cuda_free(l->output_gpu);
|
||||
|
Reference in New Issue
Block a user