From 719180e7f1101d64f043c2604e248d2c20577df1 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Tue, 24 Dec 2019 04:30:22 +0300 Subject: [PATCH] Fixed swish/mish on CPU --- src/convolutional_layer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/convolutional_layer.c b/src/convolutional_layer.c index d912e950..93e4ff37 100644 --- a/src/convolutional_layer.c +++ b/src/convolutional_layer.c @@ -515,10 +515,13 @@ convolutional_layer make_convolutional_layer(int batch, int steps, int h, int w, l.x = (float*)calloc(total_batch * l.outputs, sizeof(float)); l.x_norm = (float*)calloc(total_batch * l.outputs, sizeof(float)); } - - if (l.activation == SWISH || l.activation == MISH) l.activation_input = (float*)calloc(total_batch*l.outputs, sizeof(float)); #endif // not GPU } + +#ifndef GPU + if (l.activation == SWISH || l.activation == MISH) l.activation_input = (float*)calloc(total_batch*l.outputs, sizeof(float)); +#endif // not GPU + if(adam){ l.adam = 1; l.m = (float*)calloc(l.nweights, sizeof(float));