ExecutionProviderCatalog クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ONNX ランタイムで使用する AI 実行プロバイダー (IP) を検出、取得、登録するメソッドを提供します。
ExecutionProviderCatalog は、パッケージ管理とハードウェアの選択の複雑さを処理し、Windows ML ランタイムを介してハードウェア最適化機械学習アクセラレーションにアクセスするためのアプリのエントリ ポイントです。
public ref class ExecutionProviderCatalog sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ExecutionProviderCatalog final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ExecutionProviderCatalog
Public NotInheritable Class ExecutionProviderCatalog
- 継承
- 属性
例
// Get the default catalog
var catalog = Microsoft.Windows.AI.MachineLearning.ExecutionProviderCatalog.GetDefault();
// Ensure and register all compatible execution providers
await catalog.EnsureAndRegisterCertifiedAsync();
// Use ONNX Runtime directly for inference (using Microsoft.ML.OnnxRuntime namespace)
// Get the default catalog
winrt::Microsoft::Windows::AI::MachineLearning::ExecutionProviderCatalog catalog =
winrt::Microsoft::Windows::AI::MachineLearning::ExecutionProviderCatalog::GetDefault();
// Ensure and register all compatible execution providers
catalog.EnsureAndRegisterCertifiedAsync().get();
// Use ONNX Runtime C API directly for inference
import winui3.microsoft.windows.ai.machinelearning as winml
# Get the default catalog
catalog = winml.ExecutionProviderCatalog.get_default()
# DO NOT call winml's register methods in Python. Those will not work for the onnxruntime Python environment.
# Instead, register execution providers following this pattern:
providers = catalog.find_all_providers()
for provider in providers:
provider.ensure_ready_async().get()
ort.register_execution_provider_library(provider.name, provider.library_path)
メソッド
| 名前 | 説明 |
|---|---|
| EnsureAndRegisterCertifiedAsync() |
ONNX ランタイムで使用する AI 実行プロバイダー (IP) を検出、取得、登録するメソッドを提供します。 ExecutionProviderCatalog は、パッケージ管理とハードウェアの選択の複雑さを処理し、Windows ML ランタイムを介してハードウェア最適化機械学習アクセラレーションにアクセスするためのアプリのエントリ ポイントです。 |
| FindAllProviders() |
現在のハードウェアと互換性のあるすべての実行プロバイダーのコレクションを取得します。 |
| GetDefault() |
システム上のすべての実行プロバイダーへのアクセスを提供する既定の ExecutionProviderCatalog インスタンスを取得します。 |
| RegisterCertifiedAsync() |
互換性のあるすべての実行プロバイダーを、準備ができていることを確認せずに ONNX ランタイムに登録します。 これにより、コンピューターに既に存在するプロバイダーのみが登録されるため、 EnsureAndRegisterCertifiedAsync で必要になる可能性のあるダウンロード時間が長くなる可能性がなくなります。 |