expand does not allocate new memories, which means if you do
x = torch.tensor([[1], [2], [3]])
expand_x = x.expand([3,4])
x[0, 0] = 4

you will get expand_x
tensor([[4, 4, 4, 4],
        [2, 2, 2, 2],
        [3, 3, 3, 3]])

If you use repeat_x = x.repeat(1, 4), changing x will not affect repeat_x.