1 Commits

Author SHA1 Message Date
Raul
769302afd3 Add a constructor to TorchForce that takes a torch::jit::Module (#97)
* Add version number as a member to TorchForceProxy

* Encode the model file contents when serializing TorchForce

* Add tests for new TorchForce serialization

* Fix test not finding Python executable

* Format include directives correctly

* Hardcode TorchForceProxy version number

* Fix formatting issues

* Move Python serialization test to the correct place

* Make function encodeFromFileName static

* Update serialization python test to correctly remove temporary files after executing

* Use the base64 encoding capabilities of openssl to serialize model file

* Update TorchForce serializer

* Add a constructor to TorchForce that takes a torch::jit::Module.
 TorchForce(string fileName) is implemented by delegating to the new
 constructor.
 Update serialization test accordingly to compare the module file name
 and the module itself.

* Remove unnecessary include

* Change i_file to file in TorchForce constructor

* Add swig typemaps to new TorchForce constructor

* Add setup.py as a dependency for the PythonInstall CMake rule

* Fix swig out typemap for torch::jit::Module
 Now it is possible to call getModule() on a TorchForce object from
 Python, which will return a module of the same type as, for instance, torch.jit.load()

* Remove commented line in CMakeLists.txt

* Remove unnecessary dependency in setup.py

* Add more tests for new constructor

* Add some comments for the new constructor

* Updates to TorchForce serialization

* Use hex encoding instead of base64 for serialization.
SSL no longer a direct dependency.

* Remove unnecessary header

* Update Python serialization test

* Minor changes

* Improve temporary path handling in python serialization tests

* More informative exception when failing to serialize TorchForce

* Remove unnecessary check in TorchForce serialization

* Changes to C++ serialization tests

* Changes to C++ serialization tests
2023-02-10 14:58:03 -08:00