From 95ef51432218683ec90fdbaa2e92007f4fbd4610 Mon Sep 17 00:00:00 2001 From: txh18 Date: Mon, 21 Dec 2015 16:58:35 +0800 Subject: added a garbace collect in tnn --- nerv/tnn/tnn.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/nerv/tnn/tnn.lua b/nerv/tnn/tnn.lua index 7ae3172..5351053 100644 --- a/nerv/tnn/tnn.lua +++ b/nerv/tnn/tnn.lua @@ -77,6 +77,7 @@ function TNN.make_initial_store(st, p, dim, batch_size, chunk_size, extend_t, gl st_c[i + t_c][p_c] = st[i][p] end end + collectgarbage("collect") --free the old one to save memory end function TNN:out_of_feedrange(t) --out of chunk, or no input, for the current feed -- cgit v1.2.3-70-g09d2