Based on the docs 25, matmul will broadcast to make inputs compatible.
From this line 19, it seems the following script will expand and make copies (1000 copies) of the second tensor (to due contiguous()).
x = torch.rand(1000, 10, 3, 4)
y = torch.rand(10, 4, 5)
z = torch.matmul(x, y)

If this is correct, we should change the docs since we are assuming not making copies when broadcasting here 14.