aboutsummaryrefslogtreecommitdiff
path: root/examples/cumatrix_example.lua
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2015-05-28 12:59:30 +0800
committerDeterminant <ted.sybil@gmail.com>2015-05-28 12:59:30 +0800
commit9791a4c03cd6ae0f7403daa8f6ba84b6c523c5a7 (patch)
treefa35de648494ec3e6be43cd3ae8a9ee12070e7f7 /examples/cumatrix_example.lua
parent51ee28426b992b1421ded46721ade7a57b0a1896 (diff)
change softmax to in-place operation and fix memory leak
Diffstat (limited to 'examples/cumatrix_example.lua')
-rw-r--r--examples/cumatrix_example.lua6
1 files changed, 4 insertions, 2 deletions
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)