Skip to content
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

AttributeError: 'pymc3' object has no attribute 'switch' #319

Closed
vladserkoff opened this issue Oct 5, 2016 · 4 comments
Closed

AttributeError: 'pymc3' object has no attribute 'switch' #319

vladserkoff opened this issue Oct 5, 2016 · 4 comments

Comments

@vladserkoff
Copy link

Hey, thanks for the transition to pymc3!
There's probably a typo in the 8th cell in Intro Chapter
Should lambda_ = pm.switch(tau >= idx, lambda_1, lambda_2) be lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2) instead?

@twiecki
Copy link
Contributor

twiecki commented Oct 5, 2016

Thanks! CC @mmargenot

@mmargenot
Copy link
Contributor

mmargenot commented Oct 5, 2016

Yeah, that looks like it is due to a more recent change in the package.

Both
lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)

and
import theano.tensor as tt
lambda_ = tt.switch(tau >= idx, lambda_1, lambda_2)

should work.

@twiecki
Copy link
Contributor

twiecki commented Oct 7, 2016

Closed by #321 .

@vladserkoff
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants