aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/cumatrix_example.lua6
-rw-r--r--examples/cumatrix_from_mmatrix.lua8
2 files changed, 10 insertions, 4 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)
diff --git a/examples/cumatrix_from_mmatrix.lua b/examples/cumatrix_from_mmatrix.lua
index 1aac1c4..2309e14 100644
--- a/examples/cumatrix_from_mmatrix.lua
+++ b/examples/cumatrix_from_mmatrix.lua
@@ -24,5 +24,9 @@ dc[1]:copy_tod(dc[0])
print("dc[1] copied to dc[0]")
print(dc)
print("softmax of fc and dc")
-print(fc:softmax())
-print(dc:softmax())
+sfc = fc:create()
+sdc = dc:create()
+sfc:softmax(fc)
+print(sfc)
+sdc:softmax(dc)
+print(sdc)