1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-13 02:35:50 +02:00
ffmpeg/tests/dnn
Martin Storsjö f4d8fad802 dnn-layer-mathbinary-test: Fix tests for cases with extra intermediate precision
This fixes tests on 32 bit x86 mingw with clang, which uses x87
fpu by default.

In this setup, while the get_expected function is declared to
return float, the compiler is (especially given the optimization
flags set) free to keep the intermediate values (in this case,
the return value from the inlined function) in higher precision.

This results in the situation where 7.28 (which actually, as
a float, ends up as 7.2800002098), multiplied by 100, is
728.000000 when really forced into a 32 bit float, but 728.000021
when kept with higher intermediate precision.

For the multiplication case, a more suitable epsilon would e.g.
be 2*FLT_EPSILON*fabs(expected_output), but just increase the
current hardcoded threshold for now.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-04-24 14:41:06 +03:00
..
.gitignore dnn-layer-mathbinary-test: add unit test for subtraction 2020-04-07 11:04:40 +08:00
dnn-layer-conv2d-test.c dnn: add tf.nn.conv2d support for native model 2019-10-30 10:31:55 -03:00
dnn-layer-depth2space-test.c avfilter/dnn: unify the layer execution function in native mode 2019-10-15 18:56:25 -03:00
dnn-layer-mathbinary-test.c dnn-layer-mathbinary-test: Fix tests for cases with extra intermediate precision 2020-04-24 14:41:06 +03:00
dnn-layer-maximum-test.c FATE/dnn: add unit test for layer maximum 2019-09-20 10:57:23 -03:00
dnn-layer-pad-test.c FATE/dnn: fix stack buffer overflow 2019-10-04 09:58:22 -03:00
Makefile dnn-layer-mathbinary-test: add unit test for subtraction 2020-04-07 11:04:40 +08:00