need to 'import theano' in theano.compile.builders to be able to access theano.gradient.grad.