Function executorch_sys::torch::executor::util::MmapDataLoader_from

source ·
pub unsafe extern "C" fn MmapDataLoader_from(
    file_name: *const c_char,
    mlock_config: MmapDataLoader_MlockConfig,
) -> Result<MmapDataLoader>
Expand description

Creates a new MmapDataLoader that wraps the named file. Fails if the file can’t be opened for reading or if its size can’t be found.

@param[in] file_name The path to the file to load from. The file will be kept open until the MmapDataLoader is destroyed, to avoid the overhead of opening it again for every Load() call. @param[in] mlock_config How and whether to lock loaded pages with mlock().