Create theano custom operation with [tt.dmatrix, tt.dmatrix] input

I think that your problem is that you’re using tensor constants. Those can’t be used as inputs to a function in theano. Try replacing tens_a and tens_b with simple dmatrix.