tryLoadDefault static method

OnnxFfi? tryLoadDefault()

Attempts to load ONNX Runtime from default locations.

Searches in:

  1. Current directory
  2. System library paths
  3. Common installation locations

Implementation

static OnnxFfi? tryLoadDefault() {
  final paths = _getDefaultLibraryPaths();

  for (final path in paths) {
    try {
      return load(path);
    } on OnnxLoadException {
      // Try next path
      continue;
    }
  }

  return null;
}