OK I agree that part is not necessary, actually I've realized that Eig class has the same behavior: https://github.com/Theano/Theano/blob/master/theano/sandbox/linalg/ops.py#L934, That is probably where I borrowed it.