Mentions légales du service

Skip to content
Snippets Groups Projects
  • ANDREY Paul's avatar
    996b22a6
    Enhance unit tests to take device-placement policy into account. · 996b22a6
    ANDREY Paul authored
    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.
    Verified
    996b22a6
    History
    Enhance unit tests to take device-placement policy into account.
    ANDREY Paul authored
    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.