nvidia.dali.experimental.dynamic.io.file.read#

nvidia.dali.experimental.dynamic.io.file.read(filepaths, /, *, batch_size=None, device=None, dont_use_mmap=None, use_o_direct=None)#

Reads raw file contents from an encoded filename represented by a 1D byte array.

Note

To produce a compatible encoded filepath from Python (e.g. in an external_source node generator), use np.frombuffer(filepath_str.encode(“utf-8”), dtype=types.UINT8).

Supported backends
  • ‘cpu’

Parameters:

filepaths (Tensor/Batch) – File paths to read from.

Keyword Arguments:
  • dont_use_mmap (bool, optional, default = False) –

    If set to True, it will use plain file I/O instead of trying to map the file into memory.

    Mapping provides a small performance benefit when accessing a local file system, but for most network file systems, it does not provide a benefit

  • use_o_direct (bool, optional, default = False) –

    If set to True, the data will be read directly from the storage bypassing system cache.

    Mutually exclusive with dont_use_mmap=False.