ユーザー指定の ID3D12Resource から tensor オブジェクト (TensorFloat、TensorInt32Bit) を作成します。
HRESULT CreateFromD3D12Resource(
ID3D12Resource *value,
[size_is(shapeCount)] __int64 *shape,
int shapeCount,
[out] IUnknown ** result);
パラメーター
名前 | タイプ | 説明 |
---|---|---|
価値 | ID3D12リソース* | テンソルの作成元となる ID3D12Resource。 |
図形 | __int64* | テンソルの図形。 |
シェイプカウント | int | テンソルの次元の数。 |
結果 | IUnknown** | 結果のテンソル。 |
返品ポリシー
HRESULT 操作の結果。
例示
TensorFloat SoftwareBitmapToDX12Tensor(SoftwareBitmap softwareBitmap)
{
// ...
// GPU tensorize
com_ptr<ITensorStaticsNative> tensorfactory = get_activation_factory<TensorFloat, ITensorStaticsNative>();
com_ptr<::IUnknown> spUnkTensor;
TensorFloat input1imagetensor(nullptr);
int64_t shapes[4] = { 1,3, softwareBitmap.PixelWidth(), softwareBitmap.PixelHeight() };
CHECK_HRESULT(tensorfactory->CreateFromD3D12Resource(pGPUResource.get(), shapes, 4, spUnkTensor.put()));
spUnkTensor.try_as(input1imagetensor);
// ...
}
こちらも参照ください
要求事項
要件 | |
---|---|
サポートされる最小クライアント | Windows 10 ビルド 17763 |
サポートされている最小のサーバー | Windows Server 2019 とデスクトップ エクスペリエンス |
ヘッダー | windows.ai.machinelearning.native.h |
注
Windows ML に関するヘルプについては、次のリソースを参照してください。
- Windows ML に関する技術的な質問をしたり、質問に回答したりするには、Stack Overflow の windows-machine-learning タグを使用してください。
- バグを報告するには、GitHub で問題を提出してください。