Mapping values in a tensor

I think this is what you’re looking for Cv2 remap in pytorch? - #10 by Felix_Lessange