Let me see if I get your problem right: are you talking something like this?
b = b.view(1,-1)
for i in range(col_u):
       sum = 0
       for j in range(length(b)): # iterating through cols in u
               sum += b[j]* u[: , i]

        A[i,:] = sum