aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2015-05-28 14:09:25 +0800
committerDeterminant <ted.sybil@gmail.com>2015-05-28 14:09:25 +0800
commitfa2ad1f126428adf80aa318cf18694b251a8a710 (patch)
tree5976c5013846b30174aee86b28b8029ea5e6f5ab /examples
parent9791a4c03cd6ae0f7403daa8f6ba84b6c523c5a7 (diff)
parentba66e109a89d5aff4d709cf0865da60d4d873fee (diff)
Merge branch 'master' of https://github.com/cloudygoose/nerv into cloudygoose-master
Conflicts: examples/cumatrix_from_mmatrix.lua
Diffstat (limited to 'examples')
-rw-r--r--examples/cumatrix_from_mmatrix.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/cumatrix_from_mmatrix.lua b/examples/cumatrix_from_mmatrix.lua
index 964d008..2309e14 100644
--- a/examples/cumatrix_from_mmatrix.lua
+++ b/examples/cumatrix_from_mmatrix.lua
@@ -1,5 +1,5 @@
-m = 10
-n = 10
+m = 3
+n = 4
fm = nerv.MMatrixFloat(m, n)
dm = nerv.MMatrixDouble(m, n)
for i = 0, m - 1 do
@@ -15,10 +15,15 @@ print(dm)
fc = nerv.CuMatrixFloat(m, n)
dc = nerv.CuMatrixDouble(m, n)
-fc:copy_from(fm)
-dc:copy_from(dm)
+fc:copy_fromh(fm)
+dc:copy_fromh(dm)
+print("fc and dc")
print(fc)
print(dc)
+dc[1]:copy_tod(dc[0])
+print("dc[1] copied to dc[0]")
+print(dc)
+print("softmax of fc and dc")
sfc = fc:create()
sdc = dc:create()
sfc:softmax(fc)