From 23cb35e6c8eae8b59fab161036ae3f417a55c8db Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Fri, 30 Mar 2018 11:46:51 +0000
Subject: [PATCH] Changed small_object

---
 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..01e133b 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