Created
July 29, 2014 14:26
-
-
Save kastnerkyle/29be76e78adaebaa2b69 to your computer and use it in GitHub Desktop.
Example of using theano.clone to replace an input
This file contains hidden or 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.tensor as T | |
import theano | |
a = T.vector() | |
b = T.matrix() | |
fa = a ** 2 | |
f = theano.function([a], fa) | |
f2 = theano.function([b], theano.clone(fa, replace={a: b}, strict=False)) | |
print(f([2])) | |
print(f2([[2]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment