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
numpy 1.12.0rc2 compatibility fix related to variable typecasting #5406
Conversation
@@ -116,6 +117,11 @@ def make_node(self, n, p, shape): | |||
n = tensor.as_tensor_variable(n) | |||
p = tensor.as_tensor_variable(p) | |||
shape = tensor.as_tensor_variable(shape) | |||
|
|||
assert n.dtype in discrete_dtypes | |||
assert p.dtype not in discrete_dtypes |
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.
p is a probability, shouldn't it be a float?
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.
yeah..so, change "assert p.dtype not in discrete_dtypes" to "assert p.dtype in float_dtypes" ?
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.
Let's try that, it will avoid user errors.
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.
sure, committed the changes.. also confirmed that the nosetests still pass
jenkins test this |
jenkins test this |
@nouiz , looks good to me once jenkins passes, can you double-check? |
ok for me too. |
Fix for TypeError: Cannot cast array data from dtype('float32') to dtype('int64') according to the rule 'safe' can be fixed by making the cast explicit, casting="unsafe".
related to 5396