It there an efficient way to perform this operation? 2D.
The naive approach is to either loop through the rows and columns or construct the matrix and multiply.
Oddly I was unable to find an example of how to do this for either theano or tensorflow.