From c9b8bdee1886df5f83973d91c3597c28f99a9e0c Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Sun, 06 May 2018 18:51:31 +0000
Subject: [PATCH] Minor fix - what pip-packages are required for Python scripts

---
 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