Nevermind, I solved it.
The issue was with how I added the tensor together.
Instead of
y = torch.cat((residual, x))

simply changing to
y = residual + x

resolved the error.
The model is now running, thanks again!