diff options
author | Determinant <ted.sybil@gmail.com> | 2016-04-19 16:03:58 +0800 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2016-04-19 16:03:58 +0800 |
commit | bfe8469abcab65a8bed43e549e42e5d3a5cfec14 (patch) | |
tree | 36ccb02087aeff02370108c0408e19052e544ede /nerv/matrix/init.lua | |
parent | 8f6eb50628cadbd0e831d72c4528400b94431ee6 (diff) |
add doc for nerv.Network; remove the generated HTML doc
Diffstat (limited to 'nerv/matrix/init.lua')
-rw-r--r-- | nerv/matrix/init.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nerv/matrix/init.lua b/nerv/matrix/init.lua index 722c780..5d0544a 100644 --- a/nerv/matrix/init.lua +++ b/nerv/matrix/init.lua @@ -37,10 +37,6 @@ function nerv.Matrix:__tostring__() return table.concat(strt) end ---- Assign each element in a matrix using the value returned by a callback `gen`. --- @param gen the callback used to generated the values in the matrix, to which --- the indices of row and column will be passed (e.g., `gen(i, j)`) - function nerv.Matrix:_generate(gen) if (self:dim() == 2) then for i = 0, self:nrow() - 1 do @@ -51,11 +47,14 @@ function nerv.Matrix:_generate(gen) end else for j = 0, self:ncol() - 1 do - self[j] = gen(j) + self[j] = gen(j) end end end +--- Assign each element in a matrix using the value returned by a callback `gen`. +-- @param gen the callback used to generated the values in the matrix, to which +-- the indices of row and column will be passed (e.g., `gen(i, j)`) function nerv.Matrix:generate(gen) local tmp if nerv.is_type(self, 'nerv.CuMatrixFloat') then |