https://github.com/GPflow/GPflow
Revision f8ee093244ad3a1666d282ca5bb1c26c8768a175 authored by Vincent Dutordoir on 26 February 2020, 09:52:47 UTC, committed by GitHub on 26 February 2020, 09:52:47 UTC
GPflow makes use of a multipledispatch Dispatcher that internally uses a generator. However, according to TensorFlow [Capabilities and Limitations](https://github.com/tensorflow/tensorflow/blob/560e2575ecad30bedff5b192f33f6d06b19ccaeb/tensorflow/python/autograph/LIMITATIONS.md) generators are not supported by AutoGraph and probably will never be. Thus, compiling code that passed though the dispatcher led to the following warnings: ```bash WARNING:tensorflow:Entity <bound method Dispatcher.dispatch_iter of <dispatched sample_conditional>> appears to be a generator function. It will not be converted by AutoGraph. WARNING: Entity <bound method Dispatcher.dispatch_iter of <dispatched sample_conditional>> appears to be a generator function. It will not be converted by AutoGraph. WARNING:tensorflow:Entity <bound method Dispatcher.dispatch_iter of <dispatched conditional>> appears to be a generator function. It will not be converted by AutoGraph. WARNING: Entity <bound method Dispatcher.dispatch_iter of <dispatched conditional>> appears to be a generator function. It will not be converted by AutoGraph. ``` This PR still uses the same dispatcher, but overwrites the problematic method that uses python generators and replaces it by a simple list. ### NOTE As of this PR we do not need to write `autograph=False` in `tf.function` anymore, and all the code inside dispatching gets compiled the same way as everything else :) !
1 parent 002b217
Tip revision: f8ee093244ad3a1666d282ca5bb1c26c8768a175 authored by Vincent Dutordoir on 26 February 2020, 09:52:47 UTC
Remove the use of generator in dispatcher (#1264)
Remove the use of generator in dispatcher (#1264)
Tip revision: f8ee093
File | Mode | Size |
---|---|---|
conditionals | ||
config | ||
covariances | ||
expectations | ||
inducing_variables | ||
kernels | ||
likelihoods | ||
models | ||
optimizers | ||
utilities | ||
__init__.py | -rw-r--r-- | 1.0 KB |
base.py | -rw-r--r-- | 10.2 KB |
ci_utils.py | -rw-r--r-- | 1.1 KB |
kullback_leiblers.py | -rw-r--r-- | 4.7 KB |
logdensities.py | -rw-r--r-- | 3.0 KB |
mean_functions.py | -rw-r--r-- | 5.8 KB |
probability_distributions.py | -rw-r--r-- | 1.7 KB |
py.typed | -rw-r--r-- | 27 bytes |
quadrature.py | -rw-r--r-- | 7.7 KB |
versions.py | -rw-r--r-- | 177 bytes |
Computing file changes ...