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_example.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/cumatrix_example.lua') diff --git a/examples/cumatrix_example.lua b/examples/cumatrix_example.lua index f8235eb..084dcca 100644 --- a/examples/cumatrix_example.lua +++ b/examples/cumatrix_example.lua @@ -11,10 +11,12 @@ for i = 0, m - 1 do end end print(fm) -fs = fm:softmax() +fs = fm:create() +fs:softmax(fm) -- print(fs) print(dm) -ds = dm:softmax() +ds = dm:create() +ds:softmax(dm) -- print(ds) print(fs) print(fs + fs) -- cgit v1.2.3