In your code you are interleaving dimensions, which I tried to mention in:

as long as you don’t permute the dimensions, view will yield the original tensor

I’m also unsure how the for loop approach would work and if you have a typo or of you want to replace the values in img. Should the indexing be [i:(i+1)*272, j:(j+1)*352]?
The reshape operation is also failing, as it seems you want to flatten it to (2, 2, 272, 352).