diff options
Diffstat (limited to 'nerv/matrix/init.lua')
-rw-r--r-- | nerv/matrix/init.lua | 26 |
1 files changed, 13 insertions, 13 deletions
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 |