Pardon me for a basic question(I am new to Theano)!
I want to get the difference of 2 matrices for only those positions that satisfy a condition. So, suppose we have 2 matrices A and B, this(python equivalent code) is what I want to calculate:
sum = 0
n,m = A.shape
for i in xrange(n):
for j in xrange(m):
if(A[i][j] != 3.5): #some random condition!
sum += A[i][j] - B[i][j]
I want a Theano equivalent code to calculate the sum. I know there is Theano.scan that can be used to scan an ndarray, but I could not get any example that has an if condition. Thank you in advance :)