img is a (H, W, C) tensor (height, width, channels — the common image layout). Return it rearranged to (C, H, W), the layout most PyTorch models expect.
img
(H, W, C)
(C, H, W)
solve(...)