aboutsummaryrefslogtreecommitdiff
path: root/cumatrix_example.lua
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-22 10:26:12 +0800
committerDeterminant <[email protected]>2015-05-22 10:26:12 +0800
commit8f18aaba322cf717b8805ebfcacb5a3108d3dda8 (patch)
tree366b86e2be668da0cf0a7ae430d5d161145b4c16 /cumatrix_example.lua
parent7503135d355275a17128f8a4c897739669fcd646 (diff)
add base class CuMatrix for CuMatrixFloat and CuMatrixDouble
Diffstat (limited to 'cumatrix_example.lua')
-rw-r--r--cumatrix_example.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/cumatrix_example.lua b/cumatrix_example.lua
index aeb5828..26e1dc4 100644
--- a/cumatrix_example.lua
+++ b/cumatrix_example.lua
@@ -1,7 +1,7 @@
m = 10
n = 10
-fm = nerv.FloatCuMatrix(m, n)
-dm = nerv.DoubleCuMatrix(m, n)
+fm = nerv.CuMatrixFloat(m, n)
+dm = nerv.CuMatrixDouble(m, n)
for i = 0, m - 1 do
for j = 0, n - 1 do
-- local t = math.random(10)
@@ -10,11 +10,11 @@ for i = 0, m - 1 do
dm[i][j] = t
end
end
-print(fm)
+-- print(fm)
fs = fm:softmax()
-print(fs)
-print(dm)
+-- print(fs)
+-- print(dm)
ds = dm:softmax()
-print(ds)
+-- print(ds)
print(fs + fs)
print(fs - fs)