CreateModelEditorSessionFromArray property

Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtEnv> env, Pointer<Void> model_data, Size model_data_length, Pointer<OrtSessionOptions> options, Pointer<Pointer<OrtSession>> out)>> CreateModelEditorSessionFromArray
getter/setter pair

\brief Create an OrtSession to augment an existing model.

Create an OrtSession with an existing model that will be augmented with additional nodes and initializers. Nodes can be added before or after the existing nodes in the model. ONNX Runtime will connect the nodes when the model is finalized.

To add nodes and initializers to the existing model, first create an OrtModel using CreateModel. Add nodes and initializers to the OrtModel using AddNodeToGraph and AddInitializerToGraph. Graph inputs/outputs should be updated with SetGraphInputs and SetGraphOutputs as needed to reflect changes made by the new nodes. The list of graph inputs/outputs should be for the overall model and not just the new nodes.

Add the new information from the OrtModel to the original model using ApplyModelToSession, and prepare the session for inferencing by calling FinalizeModelEditorSession.

\param{in} env The OrtEnv instance. \param{in} model_data The model data for the existing model to augment. \param{in} model_data_length The length of the model data. \param{in} options The OrtSessionOptions instance. \param{out} out The created OrtSession instance.

\snippet{doc} snippets.dox OrtStatus Return Value

\since Version 1.22.

Implementation

external ffi.Pointer<
  ffi.NativeFunction<
    OrtStatusPtr Function(
      ffi.Pointer<OrtEnv> env,
      ffi.Pointer<ffi.Void> model_data,
      ffi.Size model_data_length,
      ffi.Pointer<OrtSessionOptions> options,
      ffi.Pointer<ffi.Pointer<OrtSession>> out,
    )
  >
>
CreateModelEditorSessionFromArray;