For example:
self = output
torch.addmm(alpha, self, beta, matrix1, matrix2, out=output)
At the entrance to the call, self and out are the same object. However, the broadcasting code always creates a new self tensor for the call to expand().
(https://github.com/pytorch/pytorch/blob/master/tools/cwrap/plugins/Broadcast.py)
Some code in TH and THC checks for object identity, which this breaks:
https://github.com/pytorch/pytorch/blob/master/torch/lib/TH/generic/THTensorMath.c#L1306