Good point! I’m not sure about numpy, but in terms of Theano I believe this is the right idea 
import theano
from theano import tensor
import numpy as np
a = tensor.matrix()
b = tensor.matrix()
elem_sub = a[0,0] - b[0,0], a[0,1] - b[1,0], a[0,2] - b[2,0]
function = theano.function([a,b], elem_sub)
d = function(np.array([[0, 0,0]]), np.array([[1],
[1],
[1]]))
print(d)
>>>
[array(-1.), array(-1.), array(-1.)]