ModelCompilationOptions_SetOutputModelWriteFunc property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtModelCompilationOptions> model_compile_options, OrtWriteBufferFunc write_func, Pointer<Void> state)>> ModelCompilationOptions_SetOutputModelWriteFunc
getter/setter pair

\brief Sets a OrtWriteBufferFunc function that is called by ORT to write out the output model's serialized ONNX bytes.

The provided write function may be called repeatedly until then entire output model has been written out. Each call to the write function is expected to consume the entire input buffer.

The output model's destination (e.g., file path, memory buffer, or stream) can be set with any of the functions that begin with ModelCompilationOptions_SetOutputModel____.

\paramin model_compile_options The OrtModelCompilationOptions instance. \paramin write_func The OrtWriteBufferFunc function called by ORT when writing out the model. \paramin state Opaque state passed as the first argument to OrtWriteBufferFunc. Can be NULL.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.23.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtModelCompilationOptions> model_compile_options,
      OrtWriteBufferFunc write_func,
      ffi.Pointer<ffi.Void> state,
    )
  >
>
ModelCompilationOptions_SetOutputModelWriteFunc;