Defined in File file.h
abstract input file interface
reset to beginning of input stream
skip given number of bytes
read data into buffer
return current read offset
read into a host tensor
The default implementation uses read(); an alternative implementation might directly reset the storage of dest to utilize zero-copy.
read with sharing memory (i.e. use zero-copy if possible)
The default implementation allocates a new buffer and call read().
Note that there is no alignment guarantee.
Public Static Functions
create an InputFile correspoding to a file on local file system
create an InputFile correspoding to a memory region; the memory region must be alive throughout lifespan of this InputFile
create an InputFile that would directly reuse the memory buffer to load tensor values
writable: whether the input memory region can be modified. If this is set to true, tensor storage can be aggressively shared by reusing the buffer for alignment.