LINK: https://github.com/torch/torch7/blob/master/doc/serialization.md
Torch provides 4 high-level methods of serialize/deserialize arbitrary Lua/Torch objects. These functions are just abstractions over the File object, and were created for convenience (these are very common routines).
The first two functions are useful to serialize/deserialize data to/from files:
torch.save(filename, object [, format])
[object] torch.load(filename [, format])
The format can be set to ascii or binary (default is binary).
The next two functions are useful to serialize/deserialize data to/from strings:
[str] torch.serialize(object)
[object] torch.deserialize(str)