Created
September 15, 2014 20:03
-
-
Save MarcCote/1e0a8b7d7a5a1ff002f3 to your computer and use it in GitHub Desktop.
Unexpected behaviour when summing stacked tensors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theano | |
import theano.tensor as T | |
import numpy as np | |
A = theano.shared(np.array([1, 2, 3, 4, 5])) | |
print "Theano" | |
print T.sum(T.stack(A, A), axis=0).eval() | |
print T.sum(T.stack(A, A), axis=1).eval() | |
print "Numpy" | |
print np.sum(T.stack(A, A).eval(), axis=0) | |
print np.sum(T.stack(A, A).eval(), axis=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment