I don’t believe the used tensors have the same shape, as pos’ shape is given as [7, 2] and pixel_values’ as [7, 1080, 1920, 3]. If you reshape the latter one you’ll get the previously posted error message:
pos = torch.randn(7, 2)
pixel_values = torch.randn(7, 1080, 1920, 3)
pixel_values = pixel_values.view(-1, 3)
x = torch.cat([pos, pixel_values], dim=-1)
# >RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 7 but got size 14515200 for tensor number 1 in the list.

As explained before, you can’t concatenate two tensors with different sizes in more than a single dimension. In your case it’s [7, 2] and [14515200, 3].