Package ai.onnxruntime
Interface OrtModelCompilationOptions.EpContextDataWriteCallback
- Enclosing class:
- OrtModelCompilationOptions
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Receives external EPContext data during model compilation.
Each payload is copied into a new Java array that the application owns and may retain. ONNX Runtime may invoke this callback concurrently from multiple threads, so implementations must synchronize access to shared state. Throwing an exception fails compilation without falling back to filesystem output.
Methods that mutate or close the originating OrtModelCompilationOptions throw IllegalStateException while compilation is in progress. This also applies when they are called
reentrantly from this callback.
-
Method Summary
-
Method Details
-
write
Writes one complete named EPContext payload.- Parameters:
name- The logical UTF-8 data identifier stored in the EPContext node.data- The payload, owned by the application.- Throws:
Exception- If the payload cannot be written.
-