Skip to content

Instantly share code, notes, and snippets.

@censored--
Created May 24, 2016 08:15
Show Gist options
  • Save censored--/c09e92c64ec5bc703b95131f863918a2 to your computer and use it in GitHub Desktop.
Save censored--/c09e92c64ec5bc703b95131f863918a2 to your computer and use it in GitHub Desktop.
import theano.tensor as T
from theano import function
x = T.dscalar('x')
z = x**2
gz = T.grad(z, x)
f = function([x], gz)
print(f(12.2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment