ITensorStaticsNative.CreateFromD3D12Resource 메서드
사용자 지정 ID3D12Resource에서 tensor 개체(TensorFloat, TensorInt32Bit)를 만듭니다.
HRESULT CreateFromD3D12Resource(
ID3D12Resource *value,
[size_is(shapeCount)] __int64 *shape,
int shapeCount,
[out] IUnknown ** result);
매개 변수
이름 | 종류 | 설명 |
---|---|---|
value | ID3D12Resource* | 텐서를 만들 ID3D12Resource입니다. |
shape | __int64* | 텐서의 모양입니다. |
shapeCount | int | 텐서의 차원 수입니다. |
result | 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 |
Header | windows.ai.machinelearning.native.h |
참고 항목
Windows ML에 대한 도움말은 다음 리소스를 참조하세요.
- Windows ML에 대한 기술적인 질문을 하거나 질문에 답하려면, Stack Overflow에서 windows-machine-learning 태그를 사용하세요.
- 버그를 보고하려면 GitHub에서 문제를 제출하세요.