aboutsummaryrefslogtreecommitdiff
path: root/cumatrix_example.lua
diff options
context:
space:
mode:
Diffstat (limited to 'cumatrix_example.lua')
-rw-r--r--cumatrix_example.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/cumatrix_example.lua b/cumatrix_example.lua
index 88b5912..c2f2139 100644
--- a/cumatrix_example.lua
+++ b/cumatrix_example.lua
@@ -1,15 +1,15 @@
-m = 600
-n = 600
+m = 10
+n = 10
t = nerv.FloatCuMatrix(m, n)
-t2 = nerv.FloatCuMatrix(m, n)
-- print(t)
a = t[1]
for i = 0, m - 1 do
- tt = t[i]
- tt2 = t2[i]
for j = 0, n - 1 do
- tt[j] = i + j
- tt2[j] = t[i][j]
+-- t[i][j] = i + j
+ t[i][j] = math.random(10)
end
end
--- print(t:rowsum())
+print(t)
+print(t:colsum())
+print(t:colmax())
+print(t:softmax())