The Torch package contains basic classes used everywhere in Torch5.

Input-output management is provided with File (abstract class), DiskFile (file on disk), MemoryFile (file in RAM) and PipeFile (file from a piped command). These classes also handle serialization.

Storage and Tensor are the basic bricks for powerful numeric operations. MapStorage is a cool child class of Storage allowing you to directly map the content of a file to a Storage.

Timer is provided for measuring time.

Finally, Torch provides some utility functions for creating and handling Torch classes.


  1. DiskFile
  2. File
  3. MemoryFile
  4. PipeFile
  5. Storage and MapStorage
  6. Tensor
  7. Timer
  8. Torch utility functions