用于推理运行行为的一组配置

interface RunOptions {
    extra?: Record<string, unknown>;
    logSeverityLevel?: 0 | 2 | 1 | 3 | 4;
    logVerbosityLevel?: number;
    tag?: string;
    terminate?: boolean;
}

属性

extra?: Record<string, unknown>

设置单个运行配置条目。请参阅 https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/ onnxruntime_run_options_config_keys.h

此设置仅在 WebAssembly 后端可用。稍后将支持 Node.js 绑定和 react-native

示例

extra: {
memory: {
enable_memory_arena_shrinkage: "1",
}
}
logSeverityLevel?: 0 | 2 | 1 | 3 | 4

日志严重性级别。请参阅 https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h

此设置仅在 ONNXRuntime(Node.js 绑定和 react-native)或 WebAssembly 后端可用

logVerbosityLevel?: number

日志详细级别。

此设置仅在 WebAssembly 后端可用。稍后将支持 Node.js 绑定和 react-native

tag?: string

使用此设置的 Run() 调用标签

此设置仅在 ONNXRuntime(Node.js 绑定和 react-native)或 WebAssembly 后端可用

terminate?: boolean

如果为 true,尽快终止所有未完成的 OrtRun 调用

此设置仅在 WebAssembly 后端可用。稍后将支持 Node.js 绑定和 react-native

使用 TypeDoc 生成