Skip to content

Conversation

@andreh7
Copy link
Contributor

@andreh7 andreh7 commented May 13, 2018

fixes #7532

@ezyang
Copy link
Contributor

ezyang commented May 13, 2018

Can we get a test for this?

@andreh7
Copy link
Contributor Author

andreh7 commented May 13, 2018

@ezyang where would such a (unit) test have to go ?

@ezyang
Copy link
Contributor

ezyang commented May 13, 2018

test_distributions.py

@andreh7
Copy link
Contributor Author

andreh7 commented May 14, 2018

thanks, I have added a corresponding test for arguments outside the boundaries for uniform.cdf() , similar to the test for uniform.log_prob() in 5f1f34c

Copy link
Collaborator

@fritzo fritzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@ezyang ezyang merged commit 61afbbb into pytorch:master May 14, 2018
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
* fix for pytorch#7532: clamping the return value of uniform.cdf() to the range [0,1]

* removed whitespace around equals to pass flake8 tests

* added a test for uniform.cdf() with arguments outside support
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.

torch.distributions.uniform.Uniform.cdf() can return negative values or values above one

3 participants