It not actually like adding something to nothing, x = torch.randn(1, 1, 0) is empty indeed, but it has a shape.

Then, for each dimension size, the resulting dimension size is the max of the sizes of  x  and  y along that dimension.

I don’t know where you read about this, but it’s incorrect. To broadcast, two must meet the rules, check https://pytorch.org/docs/stable/notes/broadcasting.html 1. For not equal dimensions, the resulting should be the one dimension which is not 1. (Generally the larger one, except for 0 I guess.
Take the broadcasting rules this way, if two dimension is not equal and one of them is 1, repeat the one with 1 dimension to make them match.
So when performing x + y with shape [1, 1, 0] and [4, 1, 1], image that

Along the first dimension, their shapes are not equal and x has dimension 1, so x is repeated 4 times, making it [4, 1, 0] (which is still empty).
Along the second dimension, their shapes are equal, so skip.
Along the third dimension, their shapes are not equal and y has dimension 1, so y is repeated 0 times, making it [4, 1, 0] (and it becomes empty).

Then we get a empty tensor with size [4, 1, 0].