mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
[java] Relaxing CoreML test (#16777)
### Description Reduces precision on the CoreML provider test as it returns slightly different answers than the other tested providers. Checked on a 2020 13" M1 MBP. ### Motivation and Context Fixes Java CoreML test failure after #16763.
This commit is contained in:
parent
07dfe34714
commit
03c3e91b0d
1 changed files with 6 additions and 1 deletions
|
|
@ -656,7 +656,12 @@ public class InferenceTest {
|
|||
OnnxValue resultTensor = result.get(0);
|
||||
float[] resultArray = TestHelpers.flattenFloat(resultTensor.getValue());
|
||||
assertEquals(expectedOutput.length, resultArray.length);
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-6f);
|
||||
if (provider == OrtProvider.CORE_ML) {
|
||||
// CoreML gives slightly different answers on a 2020 13" M1 MBP
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-2f);
|
||||
} else {
|
||||
assertArrayEquals(expectedOutput, resultArray, 1e-6f);
|
||||
}
|
||||
} catch (OrtException e) {
|
||||
throw new IllegalStateException("Failed to execute a scoring operation", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue