Assuming you indeed wanted to permute the axes, you could run a simple test via:
# setup assuming the image has a shape of [h, w, c]
x = torch.cat((torch.zeros(4, 4, 1), torch.ones(4, 4, 1)), dim=2)

# print channels
print(x[:, :, 0]) # all zeros
print(x[:, :, 1]) # all ones

# wrong approach, which creates an interleaved output
y_wrong = x.view(2, 4, 4)

# print channels
print(y_wrong[0, :, :]) # interleaved
print(y_wrong[1, :, :]) # interleaved

# right approach
y_right = x.permute(2, 0, 1)

# print channels
print(y_right[0, :, :]) # all zeros
print(y_right[1, :, :]) # all ones