gdesjardins/Theano — comment on commit abd032a97b8ee2fe26b1bf2815c4856bd84364ba
File: theano/sandbox/linalg/ops.py line 609
By gdesjardins:

This shouldn't be necessary, mainly because linalg.diag has two behaviors
(1) when given a vector, it returns a matrix with that vector as the diagonal.
(2) when given a matrix, returns a vector which is the diagonal of the matrix.

(1) and (2) are already tested by test_alloc_diag and test_extract_diag (respectively) so its not worth duplicating those tests. This test simply makes sure that linalg.diag instantiates the right op based on the dimension of the input.

I'll add this spiel to the docstring of "test_diag".