Skip to content

Update codebase to use new theano.gof.graph stack_search, inputs, etc., generator functions #4404

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

Closed
Spaak opened this issue Jan 4, 2021 · 4 comments · Fixed by #4405
Closed

Comments

@Spaak
Copy link
Member

Spaak commented Jan 4, 2021

The API for theano.gof.graph.stack_search was updated (improved) in aesara-devs/aesara#259. This function is used here (and nowhere else in the PyMC3 codebase, I checked):

https://github.com/pymc-devs/pymc3/blob/240c372cf2709e1d3212aa5873b648aa6a6855cc/pymc3/model_graph.py#L72

At first I thought a simple change of argument names would do the trick, but this yields empty results. So I'm hoping @brandonwillard has a pointer on how to rewrite the old-style API to the new one :)

@twiecki
Copy link
Member

twiecki commented Jan 4, 2021

This is a generator now, so maybe just wrapping this into list will do the trick?

@brandonwillard
Copy link
Contributor

Yeah, wrapping the results of the new generator-based functions with list should do the trick; however, depending on how the results are used (e.g. a one-time call to node in inputs([graph]), it can be a lot more efficient to use the generator directly.

@brandonwillard brandonwillard added WIP and removed bug labels Jan 4, 2021
@brandonwillard brandonwillard changed the title Update model_graph to use new Theano stack_search API Update model_graph to use new theano.gof.graph stack_search, inputs, etc., generator functions Jan 4, 2021
@brandonwillard
Copy link
Contributor

I've just created a rel-1.0.15 release that can be used for this PR.

@brandonwillard brandonwillard changed the title Update model_graph to use new theano.gof.graph stack_search, inputs, etc., generator functions Update codebase to use new theano.gof.graph stack_search, inputs, etc., generator functions Jan 4, 2021
@brandonwillard brandonwillard linked a pull request Jan 4, 2021 that will close this issue
@Spaak
Copy link
Member Author

Spaak commented Jan 5, 2021

Ah yes of course, I got thrown off by the return value not being used in model_graph (instead the ancestors are built up as a side effect of the _expand function), but also in that case wrapping in list should work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants