Pred= model (x)
#pred shape is 4 * 4* 272,352
pred= pred.argmax(1).contiguous()
#pred shape is 4 272352
pred= pred.view(2,2,272,356).view(544,704) #gives incorrect image
#expected ordering of index is[ [0,1][2,3]]
When  use for loop i get right image
for i in rows
for j in columns
img[i:i+1 *272,j:j+1*352]= pred[index]
Index=index+1