google / qhbm-library

Quantum Hamiltonian-Based Models built on TensorFlow Quantum
https://qhbm-library.readthedocs.io/en/latest/
Apache License 2.0
40 stars 15 forks source link

Test tracing and graph mode for inference functions #136

Closed zaqqwerty closed 2 years ago

zaqqwerty commented 2 years ago

Some code breaks under one of eager or graph mode. To avoid this, we should test all methods in the EnergyInference, QuantumInference, and QHBM classes with this test decorator.

zaqqwerty commented 2 years ago

Got one weird error trying this for energy_model_utils_test:

ERROR    tensorflow:test_util.py:1911 Could not find variable variable_dot/kernel. This could mean that the variable has been deleted. In TF1, it can also mean the variable is uninitialized. Debug info: container=localhost, status error message=Container localhost does not exist. (Could not find resource: localhost/variable_dot/kernel)