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

WIP Allow downcast in metropolis and nuts functions. #1265

Closed
wants to merge 1 commit into from

Conversation

twiecki
Copy link
Member

@twiecki twiecki commented Jul 27, 2016

Alternative to #1253, related to #1246.

Unfortunately, the same error is also thrown if downcast is set to true:
TypeError: expected type_num 11 (NPY_FLOAT32) got 12 Apply node that caused the error: Elemwise{mul,no_inplace}(TensorConstant{(1, 1, 1, 1) of -2.0}, Reshape{4}.0)

@fhuszar Any ideas?

@twiecki
Copy link
Member Author

twiecki commented Jul 27, 2016

I bet the issue is the Shared variables we're using in ArrayStepShared. That's what @nouiz meant that it would be impossible to auto-cast those.

@nouiz
Copy link
Contributor

nouiz commented Jul 27, 2016

Just to clarify about the casting. If you call theano.shared() with a numpy ndarray, we will always respect its dtype. If you want to change it, call numpy.asarray(x, dtype=...) on it.

The downcast if for python int/float and with a flag, in the parameter passed to a compiled Theano function as input.

@twiecki
Copy link
Member Author

twiecki commented Jul 28, 2016

Closing in favor of #1253.

@twiecki twiecki closed this Jul 28, 2016
@twiecki twiecki deleted the allow_downcast branch September 28, 2016 07:17
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.

2 participants