private static EmbeddedOnnxRuntime.ReferencedOrtSession createSession(
            EmbeddedOnnxRuntime.ModelPathOrData model,
            EmbeddedOnnxRuntime runtime,
            OnnxEvaluatorOptions options,
            boolean tryCuda) {
        if (options == null) {
            options = OnnxEvaluatorOptions.createDefault();
        }
        try {
            boolean loadCuda = tryCuda && options.requestingGpu();
            EmbeddedOnnxRuntime.ReferencedOrtSession session = runtime.acquireSession(model, options, loadCuda);
            if (loadCuda) {
                LOG.log(Level.INFO, "Created session with CUDA using GPU device " + options.gpuDeviceNumber());
            }
            return session;
        } catch (OrtException e) {
            if (e.getCode() == OrtException.OrtErrorCode.ORT_NO_SUCHFILE) {
                throw new IllegalArgumentException("No such file: " + model.path().get());
            }
            if (tryCuda && EmbeddedOnnxRuntime.isCudaError(e) && !options.gpuDeviceRequired()) {
                LOG.log(Level.INFO, "Failed to create session with CUDA using GPU device " +
                        options.gpuDeviceNumber() + ". Falling back to CPU. Reason: " + e.getMessage());
                return createSession(model, runtime, options, false);
            }
            if (EmbeddedOnnxRuntime.isCudaError(e)) {
                throw new IllegalArgumentException("GPU device is required, but CUDA initialization failed", e);
            }
            throw new RuntimeException("ONNX Runtime exception", e);
        }
    }
Evaluates an ONNX Model by deferring to ONNX Runtime.

@author lesters
model-integration/src/main/java/ai/vespa/modelintegration/evaluator/EmbeddedOnnxEvaluator.java