Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit 996b22a6 authored by ANDREY Paul's avatar ANDREY Paul
Browse files

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
1 merge request!24Improve GPU support for TensorFlow and Torch
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment