-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the use of generator in dispatcher #1264
Conversation
doc/source/notebooks/advanced/variational_fourier_features.pct.py
Outdated
Show resolved
Hide resolved
Co-Authored-By: Artem Artemev <art.art.v@gmail.com> Co-Authored-By: st-- <st--@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vdutor +2,068 −47,924. I wish it were actual removing :)
…Pflow into vincent/multipledispatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 comments:
- I worry a bit aboutthe naming of the original package being multipledispatch (class Dispatcher), and our custom file being also called multipledispatch (class Dispatcher). its only a fat finger that changes
import .multipledispatch
toimport multipledispatch
! Why doent we change the name of our utils file togpflow_multipledispatch
orcustom_multipledispatch
- Secondly we should have some tests for this diff! A simple test is to create a dispatched function using the two dispatchers, checking the results are the same, but that one generates warnings when wrapped in tf.function!
I upvote @condnsdmatters suggestion on testing the warning. Although I don't think we need to test multipledispatch, and we definitely can use |
Co-Authored-By: Artem Artemev <art.art.v@gmail.com>
Ready for merge once tests pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Will merge this once #1265 is in develop |
…Pflow into vincent/multipledispatch
@st--, it is a bad practice to work on the branch from another author. Especially, when |
@awav yeah but this branch was off the other one and I wanted to merge them separately |
GPflow makes use of a multipledispatch Dispatcher that internally uses a generator. However, according to TensorFlow Capabilities and Limitations generators are not supported by AutoGraph and probably will never be. Thus, compiling code that passed though the dispatcher led to the following warnings:
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
intf.function
anymore, and all the code inside dispatching gets compiled the same way as everything else :) !