mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
CoreML backend should log on failure not success (#82604)
### Description The original intention of this code was to log whenever inference fails, not whenever it succeeds. This change updates the logic of should_log to match this intention. Pull Request resolved: https://github.com/pytorch/pytorch/pull/82604 Approved by: https://github.com/SS-JIA
This commit is contained in:
parent
09a6d0b5bb
commit
7d490dba72
|
|
@ -187,8 +187,7 @@ class CoreMLBackend: public torch::jit::PyTorchBackendInterface {
|
|||
// Check if this inference session is logged. If so, log every N inferences
|
||||
bool succeeded = outputsProvider != nil;
|
||||
bool should_log = load_id < kSampleThreshold && inferences > 1;
|
||||
should_log = should_log && (inferences % kSampleEvery == 0);
|
||||
should_log = should_log || succeeded;
|
||||
should_log = !succeeded || (should_log && (inferences % kSampleEvery == 0));
|
||||
observer->onExitExecuteModel(instance_key, inferences, succeeded, should_log);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user