From 9791a4c03cd6ae0f7403daa8f6ba84b6c523c5a7 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 28 May 2015 12:59:30 +0800 Subject: change softmax to in-place operation and fix memory leak --- examples/cumatrix_from_mmatrix.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'examples/cumatrix_from_mmatrix.lua') diff --git a/examples/cumatrix_from_mmatrix.lua b/examples/cumatrix_from_mmatrix.lua index fba8a90..964d008 100644 --- a/examples/cumatrix_from_mmatrix.lua +++ b/examples/cumatrix_from_mmatrix.lua @@ -19,5 +19,9 @@ fc:copy_from(fm) dc:copy_from(dm) print(fc) print(dc) -print(fc:softmax()) -print(dc:softmax()) +sfc = fc:create() +sdc = dc:create() +sfc:softmax(fc) +print(sfc) +sdc:softmax(dc) +print(sdc) -- cgit v1.2.3