To(device) changed value of input

for images, _in train_dataloader:
     print(images.min(), images.max())
     images= images.to(device)
     print(images.min(), images.max())
        ...

What could be the potential reason that the range of the images changes from [-1, 1] to [-inf, inf] after images= images.to(device)?

To be specific, after to(device), the value of images could change to any arbitrary values including Nan.

In the images shown below, after to(device), there could be horizontal or vertical lines appear on the new image and those pixel values are arbitrary.

This would usually indicate a software issue (e.g. a missing synchronization), a driver issue, or a hardware issue.
I would thus recommend to update PyTorch as well as your CUDA driver first to check if this helps. If not, try to use your GPU in another system and check if you are seeing the same issues (assuming it’s easy to reproduce). If not, it could be any other part of your local setup.

Also, double post from here, so disregard my post as you’ve already narrowed down the root cause without updating this double post.
Please avoid creating multiple posts in the future.