Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ end
function Module:reset()
end

function Module:write(file)
-- Write all values in the object as a table.
local object = {}
for k, v in pairs(self) do
object[k] = v
end
file:writeObject(object)
end

function Module:read(file)
local object = file:readObject()
for k, v in pairs(object) do
self[k] = v
end
end

-- This function is not easy to understand. It works as follows:
--
-- - gather all parameter tensors for this module (and children);
Expand Down