In [8]:
import numpy as np
import theano.tensor as T
from theano import function
x = T.dscalar('x')
y = T.dscalar('y')
z = x + y
f = function([x, y], z)
print f(2,3)
In [10]:
from theano import pp
print pp(z)
In [15]:
#matrix
x = T.dmatrix('x')
y = T.dmatrix('y')
z = x + y
#z = T.dot(x, y)
f = function([x, y], z)
print f(np.arange(12).reshape((3,4)), 10*np.ones((3,4)))
In [ ]: