-
- Downloads
Enhance unit tests to take device-placement policy into account.
Core changes to the global test suite: * Add some device-placement verifications to the generic Model test suite. This should be refactored into more unitary tests as part of a distinct effort to revise and improve this test suite. * For TensorFlow and Torch, parametrize the whole test suite to run either on CPU and GPU, and run it once per available device type. * Ensure Vector and OptiModule unit tests run on CPU. Changes to some 'Model' tests to run on GPU: * `test_compute_batch_gradients_np`: allow for small numerical discrepancies that may result from running the test on GPU. * `test_apply_updates`: correct the test, that had not been updated since `Model.get_weights` stopped to systematically use `NumpyVector` as return type. Changes to 'TorchModel' tests to run on GPU: * Override `test_serialization` due to torch-serialization relying on pickle. Replace pickles' comparison with a more shallow (but less susceptible to fail for unknown reasons) test that ensures a reloaded model shares the same structure of modules.
parent
098c26e6
No related branches found
No related tags found
Showing
- declearn/test_utils/_vectors.py 2 additions, 1 deletiondeclearn/test_utils/_vectors.py
- test/model/model_testing.py 37 additions, 8 deletionstest/model/model_testing.py
- test/model/test_sksgd.py 6 additions, 0 deletionstest/model/test_sksgd.py
- test/model/test_tflow.py 40 additions, 3 deletionstest/model/test_tflow.py
- test/model/test_torch.py 63 additions, 4 deletionstest/model/test_torch.py
- test/model/test_vector.py 4 additions, 1 deletiontest/model/test_vector.py
- test/optimizer/test_modules.py 3 additions, 1 deletiontest/optimizer/test_modules.py
Loading
Please register or sign in to comment