From 701f4fab63b3f6826ae6095ce32b9b99b3ece203 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 16 Apr 2018 14:58:08 +0000
Subject: [PATCH] Compile fix

---
 src/shortcut_layer.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/shortcut_layer.c b/src/shortcut_layer.c
index 8bca50f..87b4b08 100644
--- a/src/shortcut_layer.c
+++ b/src/shortcut_layer.c
@@ -36,6 +36,26 @@
     return l;
 }
 
+void resize_shortcut_layer(layer *l, int w, int h)
+{
+	//assert(l->w == l->out_w);
+	//assert(l->h == l->out_h);
+	l->w = l->out_w = w;
+	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));
+
+#ifdef GPU
+	cuda_free(l->output_gpu);
+	cuda_free(l->delta_gpu);
+	l->output_gpu = cuda_make_array(l->output, l->outputs*l->batch);
+	l->delta_gpu = cuda_make_array(l->delta, l->outputs*l->batch);
+#endif
+
+}
+
 void forward_shortcut_layer(const layer l, network_state state)
 {
     copy_cpu(l.outputs*l.batch, state.input, 1, l.output, 1);

--
Gitblit v1.10.0