ModelCompilationOptions_SetOutputModelBuffer property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtModelCompilationOptions> model_compile_options, Pointer<OrtAllocator> allocator, Pointer<Pointer<Void>> output_model_buffer_ptr, Pointer<Size> output_model_buffer_size_ptr)>> ModelCompilationOptions_SetOutputModelBuffer
getter/setter pair

\brief Configures model compilation to store the output compiled ONNX model in a buffer.

The caller passes an OrtAllocator that ONNX Runtime uses to allocate memory for the buffer.

The output model's location (e.g., file path or memory buffer) can be set with either ModelCompilationOptions_SetOutputModelPath or ModelCompilationOptions_SetOutputModelBuffer.

If the output model's location is not set, ONNX Runtime will generate an output file with a path based on the input model's file path. Examples: /Path/my_model.onnx -> /Path/my_model_ctx.onnx /Path/my_model -> /Path/my_model_ctx.onnx

\paramin model_compile_options The OrtModelCompilationOptions instance. \paramin allocator The allocator used to allocate the buffer for the compiled model. \paramout output_model_buffer_ptr Pointer to the buffer that stores the compiled model. \paramout output_model_buffer_size_ptr Pointer set to the size of output model in bytes.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.22.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtModelCompilationOptions> model_compile_options,
      ffi.Pointer<OrtAllocator> allocator,
      ffi.Pointer<ffi.Pointer<ffi.Void>> output_model_buffer_ptr,
      ffi.Pointer<ffi.Size> output_model_buffer_size_ptr,
    )
  >
>
ModelCompilationOptions_SetOutputModelBuffer;