diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2011-10-27 21:47:06 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2011-10-27 21:47:06 +0400 |
commit | 2b400a4dcd4d438d63d9af6650dda72271746d72 (patch) | |
tree | 03047f558c22956d9ce2ca68b1d5e4ff92228b67 | |
parent | 2bc3c864e813baf33ad0bab77e7790d6f58aa6dd (diff) |
Switched serializers (dataset) to binary.
-rw-r--r-- | DataSet.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/DataSet.lua b/DataSet.lua index 9ed7cbe..4efb85d 100644 --- a/DataSet.lua +++ b/DataSet.lua @@ -58,6 +58,7 @@ function lDataSet:load(...) -- File found print('<DataSet> Loading samples from cached file ' .. fileName) f = torch.DiskFile(fileName, 'rw') + f:binary() self:read(f) f.close(f) datasetLoadedFromFile = true @@ -73,6 +74,7 @@ function lDataSet:load(...) if (fileName ~= nil) then print('<DataSet> Dumping dataset to cache file ' .. fileName .. ' for fast retrieval') f = torch.DiskFile(fileName, 'rw') + f:binary() self:write(f) f.close(f) end @@ -301,6 +303,7 @@ function lDataSet:save(fileName) self.fileName = fileName print('<DataSet> Saving DataSet to:',fileName) local file = torch.DiskFile(fileName, 'w') + file:binary() self:write(file) file:close() end @@ -310,6 +313,7 @@ function lDataSet:open(fileName) self.fileName = fileName print('<DataSet> Loading DataSet from File:',fileName) local file = torch.DiskFile(fileName, 'r') + file:binary() self:read(file) file:close() print('<DataSet> '..self.nbSamples..' samples loaded') |