Hi,
Thanks for your reply. If you see, you are recommending the solution other way around i.e. NHWC to NCHW. I want the opposite.
I want (1, 3,128,128) to (1, 128, 128, 3) for which

value.permute(0,2,3,1)

is the correct order.
Thanks for the insight regarding forward function though.