-
Notifications
You must be signed in to change notification settings - Fork 443
Run on all devices even if other device types fail #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… bind / eval can be returned
yskim1501
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tools/WinMLRunner/src/Run.cpp
Outdated
| { | ||
| for (const auto& inputBindingType : inputBindingTypes) | ||
| HRESULT evaluateModelGivenDeviceTypeResult = | ||
| EvaluateModelGivenDeviceType(model, deviceType, inputBindingTypes, inputDataTypes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to EvaluateModelWithDeviceType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure sure! I can rename this.
Tools/WinMLRunner/src/Run.cpp
Outdated
| } | ||
| lastEvaluateModelResult = evaluateModelGivenDeviceTypeResult; | ||
| std::cout << "Run failed for DeviceType: " << TypeHelper::Stringify(deviceType) << std::endl; | ||
| ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra ; :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
|
It would be great if we can add test cases for this, but I understand that this might be hard to repro (since you should purposely fail in one of the devices, which is not what where should be at all) |
Right, it would be great to add test cases for this. However, it would be hard to find a model that purposely fails on one of the devices but passes on others. In the future, I believe using mocking framework would be best to test this. |
This PR pulls out the code in EvaluateModels that loops through all inputBindingTypes inputDataTypes and deviceCreationLocations into a separate function.
EvaluateModels loops through all deviceTypes and calls EvaluateModelGivenDeviceType