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
History
Tip revision: f8ee093244ad3a1666d282ca5bb1c26c8768a175 authored by Vincent Dutordoir on 26 February 2020, 09:52:47 UTC
Remove the use of generator in dispatcher (#1264)
Tip revision: f8ee093
File Mode Size
__init__.py -rw-r--r-- 154 bytes
reference.py -rw-r--r-- 2.0 KB
test_base.py -rw-r--r-- 2.1 KB
test_broadcasted_conditionals.py -rw-r--r-- 8.5 KB
test_conditionals.py -rw-r--r-- 5.5 KB
test_config.py -rw-r--r-- 5.1 KB
test_coregion.py -rw-r--r-- 7.4 KB
test_deepcopy.py -rw-r--r-- 1.3 KB
test_dynamic_shapes.py -rw-r--r-- 2.8 KB
test_expectations.py -rw-r--r-- 10.5 KB
test_features.py -rw-r--r-- 4.1 KB
test_gplvm.py -rw-r--r-- 4.2 KB
test_kernels.py -rw-r--r-- 19.8 KB
test_kldiv.py -rw-r--r-- 7.0 KB
test_likelihoods.py -rw-r--r-- 19.3 KB
test_logdensities.py -rw-r--r-- 4.0 KB
test_mcmc_helper.py -rw-r--r-- 6.3 KB
test_mean_functions.py -rw-r--r-- 11.2 KB
test_method_equivalence.py -rw-r--r-- 11.1 KB
test_methods.py -rw-r--r-- 10.8 KB
test_model.py -rw-r--r-- 1.5 KB
test_multioutput.py -rw-r--r-- 25.2 KB
test_multioutput_features.py -rw-r--r-- 2.2 KB
test_multipledispatch.py -rw-r--r-- 2.3 KB
test_natural_gradient.py -rw-r--r-- 4.8 KB
test_notebooks.py -rw-r--r-- 2.8 KB
test_optimizers.py -rw-r--r-- 1.9 KB
test_predict.py -rw-r--r-- 6.9 KB
test_printing.py -rw-r--r-- 17.2 KB
test_prior.py -rw-r--r-- 4.6 KB
test_quadrature.py -rw-r--r-- 2.9 KB
test_scaled_euclid_dist.py -rw-r--r-- 1.9 KB
test_training.py -rw-r--r-- 4.1 KB
test_uncertain_conditional.py -rw-r--r-- 9.3 KB
test_utilities.py -rw-r--r-- 1.6 KB
test_variational.py -rw-r--r-- 8.1 KB

back to top