What is the equivalent theano implementation of the code below without using a loop?
dt = np.dtype(np.float32)
a=[[12,3],
[2,4],
[2,4],]
b=[[12,3,2,3],
[2,4,4,5]]
a=np.asarray(a,dtype=dt)
b=np.asarray(b,dtype=dt)
print(a.shape)
print(b.shape)
ainvb=np.zeros((3,2,4))
for i in range(4):
ainvb[:,:,i]=a/b[:,i].T
the loop in numpy also can be replaced with:
ainvb=a[:,:,None]/b
What I need to do is to divide columns of "a" by each row of "b". At the end, there will 4 matrices of size 3*2 (size of "a") where each are "a" divided by one of the rows of "b".
-Regards