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
.circleci
.github
doc
gpflow
tests
.coveragerc -rw-r--r-- 283 bytes
.coveralls.yml -rw-r--r-- 23 bytes
.gitignore -rw-r--r-- 828 bytes
.pylintrc -rw-r--r-- 14.6 KB
GLOSSARY.md -rw-r--r-- 1.4 KB
LICENSE -rw-r--r-- 11.1 KB
MANIFEST.in -rw-r--r-- 182 bytes
Makefile -rw-r--r-- 597 bytes
README.md -rw-r--r-- 9.3 KB
RELEASE.md -rw-r--r-- 6.9 KB
VERSION -rw-r--r-- 9 bytes
codecov.yml -rw-r--r-- 274 bytes
contributing.md -rw-r--r-- 7.3 KB
notebooks l--------- 21 bytes
setup.py -rw-r--r-- 2.5 KB
tests_requirements.txt -rw-r--r-- 219 bytes

README.md

back to top