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

Add tests for tt.switch related bugs #4448

Merged
merged 2 commits into from
Jan 29, 2021

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jan 29, 2021

This PR adds two tests for subtle issues related to this bug in tt.switch: pymc-devs/pytensor#270

The tests are being added because these two bugs (#4389 and #4417) were rather surprising and difficult to debug. The tests fail before #4444 and pass afterwards.

I have included them in test_model::TestValueGradFunction because it seemed to be the most conceptually close block. For e.g.: https://github.com/pymc-devs/pymc3/blob/03d7af5b6dd5ad99ab2f3bd8ca7987a744dbef46/pymc3/tests/test_model.py#L338

Closes #4417

@ricardoV94 ricardoV94 changed the title Add tests for edge cases Add tests for tt.switch related bugs Jan 29, 2021
@twiecki twiecki merged commit 2d3ec8f into pymc-devs:master Jan 29, 2021
@twiecki
Copy link
Member

twiecki commented Jan 29, 2021

Thanks @ricardoV94 !

@ricardoV94 ricardoV94 deleted the test_switch_broadcasting_bugs branch January 29, 2021 16:32
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

Successfully merging this pull request may close these issues.

pm.Bound and TruncatedNormal generate wrong gradients
2 participants