Nikronic:

x = torch.randn(1, 3,1024, 1024)


I do not know what your dataset is, but you should provide inputs in the form (batch_size, 3, height, width) but you are passing them like this (batch_size, height, width, 3).
You can change the way you load your data from dataset in .__getitem__() method to get correct form in forward method or just swap dimensions in first line of your forward method.