[Torch5-devel] API Changes: MapStorage
Status: Pre-Alpha
Brought to you by:
andresy
|
From: Ronan C. <ro...@co...> - 2009-01-15 20:42:02
|
Hey
(1) Due to some serious bugs in MapStorage, I had to modify the
API. Sorry.
MapStorage no longuer exists. It is now handled by a new
constructor of Storage.
Ex: torch.CharStorage(fileName, shared)
If the optional argument "shared" is true, the mapping will be
shared amongst all processes on the computer. In that case, the file
must be with read-write access. Modifications made on the storage
will then be reflected in the file. This corresponds to the old
behavior of MapStorage.
If "shared" is false (or not provided), the file must be at least
readable. Modifications made on the storage will not affect the file.
This fixes the bug reported by Gregoire about segfault when
freeing a MapStorage.
(2) A new shortcut to create a 1D Tensor over a Storage has been
added.
Ex: s = torch.DoubleStorage(100)
t = torch.Tensor(s) -- in previous versions you had
to do torch.Tensor(s, 1, s:size())
The doc has been updated accordingly for (1) and (2) in the SVN.
Cheers
Ronan.
|