The following code will raise an issue:
x = Variable(torch.FloatTensor(10, 7).normal_(), requires_grad=True)
y = Variable(torch.FloatTensor(10, 7).normal_())
x -= x.mean(1).expand(x.size())
nn.MSELoss()(x, y).backward()
RuntimeError: inconsistent tensor size at /home/guismay/pytorch-master/torch/lib/TH/generic/THTensorMath.c:576