Hello,
I am trying to extract a diagonal matrix from a Theano tensor. When I do the equivalent operation in numpy:
arrayVals = np.zeros((5, 5, 56, 6, 74))
diagonalVals = np.diagonal(arrayVals) #shape (56,6,74,5)
This is exactly what I want. When I do the equivalent thing in Theano, I get the issue:
arrayValsTheano = T.zeros((5, 5, 56, 6, 74))
diagonalValsTheano = T.diagonal(arrayValsTheano) #ERROR
raise TypeError('ExtractDiag only works on matrices', _x)
TypeError: ('ExtractDiag only works on matrices', Reshape{5}.0)
The Theano documentation seems to portray that my "arrayValsTheano" has more than 2 dimensions (is not a matrix), thus why it complains. Any insight?
Thanks!