import theano import theano.tensor as T # creates 2 (symbolic) Theano variables; the strings in the constructors are only for output purposes x = T.scalar('x') y = T.scalar('y') # combine the variables to an expression; here, simply an addition expr = x+y # create a Theano function fn = theano.function([x,y], expr) # call the Theano function result = fn(0.4, 0.7) # print results to stdout print('%s = %g'%(theano.pp(expr), result))