AddExternalInitializersFromFilesInMemory property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtSessionOptions> options, Pointer<Pointer<Char>> external_initializer_file_names, Pointer<Pointer<Char>> external_initializer_file_buffer_array, Pointer<Size> external_initializer_file_lengths, Size num_external_initializer_files)>> AddExternalInitializersFromFilesInMemory
getter/setter pair

\brief Replace initialized Tensors with external data with the provided files in memory

The function will find the initialized TensorProtos with external data in the graph with the provided external file names and the file content in memory. The API gets the external file name, offset, data length from TensorProto, and locate the tensor data from the file in memory buffer. It creates a Tensor to replace the existing Tensor in graph. The replacement will occur before any of the optimizations take place. The data will be copied into the graph since TensorProto can't refer to the user provided buffers.

\paramin options \paramin external_initializer_file_names Array of null terminated UTF-8 encoded strings of the file names which holds the external initializers. \paramin external_initializer_file_buffer_array Array of pointers to the buffer of the file content. The buffer can be freed after session creation. \paramin external_initializer_file_lengths Array of size_t to indicate the length of file content \paramin num_external_initializer_files Number of external files

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.18.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtSessionOptions> options,
      ffi.Pointer<ffi.Pointer<ffi.Char>> external_initializer_file_names,
      ffi.Pointer<ffi.Pointer<ffi.Char>>
      external_initializer_file_buffer_array,
      ffi.Pointer<ffi.Size> external_initializer_file_lengths,
      ffi.Size num_external_initializer_files,
    )
  >
>
AddExternalInitializersFromFilesInMemory;