As ogrisel has pointed out, in the multioutput case the array of constants is 1D array. So it should be not self.constant.shape[1] != y.shape[1]. It should be like 
self.constant.shape[0] != y.shape[1]

self.output_2d_ should be checked explicitly because it should make sure that when its value is True, constant should be an array or a list.