microsoft / Windows-Machine-Learning

Samples and Tools for Windows ML.
https://docs.microsoft.com/en-us/windows/ai/
MIT License
1.02k stars 445 forks source link

fix sample so it works on the GPU #505

Closed lovettchris closed 1 year ago

lovettchris commented 1 year ago

The sample was broken when it chose to use my CUDA GPU (the testAccuracy function forgot to move the images to the device and the prediction from the device).

martinb35 commented 1 year ago

hi @lovettchris, thanks for adding this. I will approve the change, but please be aware that we will probably update these samples at some point to use the DirectML backend for PyTorch (which is a work in progress right now).