From 53d59b9fff59d657c024673a9a0b54b396feb8d6 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 28 Apr 2016 12:54:26 +0800 Subject: add doc --- nerv/matrix/init.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'nerv/matrix/init.lua') diff --git a/nerv/matrix/init.lua b/nerv/matrix/init.lua index 5d0544a..b84d735 100644 --- a/nerv/matrix/init.lua +++ b/nerv/matrix/init.lua @@ -102,21 +102,21 @@ function nerv.Matrix:__mul__(b) return c end ---- A wrapper function for `copy_from` +--- A wrapper function for `copy_from`. function nerv.Matrix:copy_to(b, ...) b:copy_from(self, ...) end ---- The base class for all device (in-GPU) matrices +--- The base class for all device (in-GPU) matrices. -- @type nerv.CuMatrix ---- A wrapper function for `copy_fromd` +--- A wrapper function for `copy_fromd`. nerv.CuMatrix.copy_tod = nerv.Matrix.copy_to ---- CUDA float matrices +--- CUDA float matrices. -- @type nerv.CuMatrixFloat ---- Create a CUDA matrix copy of the host matrix (in memory) +--- Create a CUDA matrix copy of the host matrix (in memory). -- @param mat the host matrix function nerv.CuMatrixFloat.new_from_host(mat) local res = nerv.CuMatrixFloat(mat:nrow(), mat:ncol()) @@ -124,17 +124,17 @@ function nerv.CuMatrixFloat.new_from_host(mat) return res end ---- Create a host matrix copy of the CUDA matrix +--- Create a host matrix copy of the CUDA matrix. function nerv.CuMatrixFloat:new_to_host() local res = nerv.MMatrixFloat(self:nrow(), self:ncol()) self:copy_toh(res) return res end ---- CUDA double matrices +--- CUDA double matrices. -- @type nerv.CuMatrixDouble ---- Create a CUDA matrix copy of the host matrix (in memory) +--- Create a CUDA matrix copy of the host matrix (in memory). -- @param mat the host matrix function nerv.CuMatrixDouble.new_from_host(mat) local res = nerv.CuMatrixDouble(mat:nrow(), mat:ncol()) @@ -142,25 +142,25 @@ function nerv.CuMatrixDouble.new_from_host(mat) return res end ---- Create a host matrix copy of the CUDA matrix +--- Create a host matrix copy of the CUDA matrix. function nerv.CuMatrixDouble:new_to_host() local res = nerv.MMatrixDouble(self:nrow(), self:ncol()) self:copy_toh(res) return res end ---- The base class for all host (in-memory) matrices +--- The base class for all host (in-memory) matrices. -- @type nerv.MMatrix ---- A wrapper function for `copy_fromh` +--- A wrapper function for `copy_fromh`. nerv.MMatrix.copy_toh = nerv.Matrix.copy_to ---- A wrapper function for `nerv.CuMatrix` copy +--- A wrapper function for `nerv.CuMatrix` copy. function nerv.MMatrix:copy_fromd(b, ...) b:copy_toh(self, ...) end ---- A wrapper function for `nerv.CuMatrix` copy +--- A wrapper function for `nerv.CuMatrix` copy. function nerv.MMatrix:copy_tod(b, ...) b:copy_fromh(self, ...) end -- cgit v1.2.3-70-g09d2