• Get the recommended execution providers based on WebNN availability and options

    Parameters

    • options: SessionOptions = {}

      Session options including WebNN preferences

    Returns string[]

    Array of execution provider names in order of preference

    Example

    const providers = getExecutionProviders({
    preferWebNN: true,
    webnnDeviceType: 'gpu'
    });
    // Returns: ['webnn', 'webgl', 'cpu'] if WebNN is available
    // Returns: ['webgl', 'cpu'] if WebNN is not available