[UnitTest] Make unit tests deterministic with fixed seed
Use the getSeed() method provided by Catch to initialize the random number generator instead of using the default random device. This allows to make the tests deterministic when --rng-seed <seed> option is passed. Also this allows to report a test failure by specifying the seed as reported in the test output, which can then be reproduced with --rng-seed <reported_seed>.
Showing
- unit_tests/data/Test_Tensor.cpp 5 additions, 4 deletionsunit_tests/data/Test_Tensor.cpp
- unit_tests/graph/Test_GraphView.cpp 4 additions, 3 deletionsunit_tests/graph/Test_GraphView.cpp
- unit_tests/operator/Test_Div_Op.cpp 3 additions, 2 deletionsunit_tests/operator/Test_Div_Op.cpp
- unit_tests/operator/Test_GlobalAveragePooling_Op.cpp 3 additions, 2 deletionsunit_tests/operator/Test_GlobalAveragePooling_Op.cpp
- unit_tests/operator/Test_MatMul_Op.cpp 4 additions, 2 deletionsunit_tests/operator/Test_MatMul_Op.cpp
- unit_tests/operator/Test_Mul_Op.cpp 3 additions, 2 deletionsunit_tests/operator/Test_Mul_Op.cpp
- unit_tests/operator/Test_Pow_Op.cpp 3 additions, 2 deletionsunit_tests/operator/Test_Pow_Op.cpp
- unit_tests/operator/Test_Sub_Op.cpp 3 additions, 2 deletionsunit_tests/operator/Test_Sub_Op.cpp
- unit_tests/scheduler/Test_Scheduler.cpp 2 additions, 1 deletionunit_tests/scheduler/Test_Scheduler.cpp
Please register or sign in to comment