Don’t use the .data attribute, as it might yield unexpected side effects.
Also, you are currently overriding input_img in:
input_img=input_img.view(3,64,64)
input_img=norm(input_img)
input_img=input_img.view(1,3,64,64)

so you should use another variable name to keep the original input_img tensor alive.