Question about data range when calculating loss function

Hi! My network use image data scaled from (0, 255) to (0, 1) as input and the output data is in (0, 1) too. torch.optim.Adam is used as optimizer and I calculate loss using output and ground truth in (0, 1).

Should I scale the data back to (0, 255) when calculating loss function? Is it useful in training process?