aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2015-05-28 16:14:21 +0800
committerDeterminant <[email protected]>2015-05-28 16:14:21 +0800
commite4dedc2992149d245ea65132131253072d3276b8 (patch)
tree31055890c6b662df9091dd7272556a69f216de28 /examples
parentc13115662e739b434f1071eb623a41a39d8b4985 (diff)
add mul_elem and log_elem; add dimension checking in cumatrix methods
Diffstat (limited to 'examples')
-rw-r--r--examples/cumatrix_example.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/cumatrix_example.lua b/examples/cumatrix_example.lua
index 084dcca..544fc7f 100644
--- a/examples/cumatrix_example.lua
+++ b/examples/cumatrix_example.lua
@@ -1,5 +1,5 @@
-m = 10
-n = 10
+m = 4
+n = 4
fm = nerv.CuMatrixFloat(m, n)
dm = nerv.CuMatrixDouble(m, n)
for i = 0, m - 1 do
@@ -23,3 +23,9 @@ print(fs + fs)
print(ds + ds)
print(fs - fs)
print(ds - ds)
+
+a = fs:create()
+a:mul_elem(fs, fs)
+print(a)
+a:log_elem(fs)
+print(a)