Open chaserileyroberts opened 5 years ago
The output suggests that autograph can't handle calls to contract_between: It throws a warning and falls back to non-autograph tracing.
WARNING: Entity <bound method TensorNetwork.contract_between of <tensornetwork.network.TensorNetwork object at 0x7f727b370898>> could not be transformed and will be executed as-is. Please report this to the AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting <bound method TensorNetwork.contract_between of <tensornetwork.network.TensorNetwork object at 0x7f727b370898>>: AssertionError: Early stopping (e.g. break and/or return) should create state variables.
Possibly the error handling is causing overhead? Probably we can find out what's slow using cProfile
.
PS: I think the default changed for tf.contrib.eager.defun()
, but IIRC tf.function()
also defaulted to autograph=True
with 1.13
.
Is there a way to make this a failing test?
Yes, we can test for these log messages: https://docs.pytest.org/en/latest/logging.html
What is the impact of this bug? Is it harmless to correctness?
When
tf.function(autograph=True)
, the compile times for code that usescontract_between
skyrockets. This is bad becauseautograph=True
is the default fortensorflow>=1.14.0
.We need to figure out where the bug lies, either on our end or on the tensorflow end.