

def perform(self, node, inputs, outputs):
    (x,) = inputs
    (z,) = outputs
    (N, M) = x.shape
    if (N != N):
        raise ValueError('Diag only apply on square matrix')
    z[0] = x.diagonal()

dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sparse/basic.py Diag.perform/VarMisuse@44/46 `M`->`N`