Given two tensors, A (m x n x q) and B (m x n x 1), how do you create a function which loops through rows of A, treating each element of B (n x 1) as a scalar and applying them to the vectors (q x 1) of the sub-matrices of A (n x q)?
e.g., A is (6000, 1000, 300) shape. B is (6000, 1000, 1). Loop through 6000 "slices" of A, for each vector of the 1000 sub-matrices of A (, 1000, 300), apply scalar multiplication of each element from the vectors the sub-matrices of B (, 1000, 1).
My wording may be absolutely terrible. I will adjust the phrasing accordingly as issues arise.
Sidenote: I am working with Python, so Theano is probably the best to do this in?