Hi, I find that after I use the transforms.resize() the value range of the resized image changes.
a = torch.randint(0,255,(500,500), dtype=torch.uint8)
print(a.size())
print(torch.max(a))
a = torch.unsqueeze(a, dim =0)
print(a.size())
compose = transforms.Compose([transforms.ToPILImage(),transforms.Resize((128,128))])
a_trans = compose(a)
print(a_trans.size)
print(a_trans.getextrema())

The result:
torch.Size([500, 500])
tensor(254, dtype=torch.uint8)
torch.Size([1, 500, 500])
(128, 128)
(79, 179)

The original range is [0,255], after the transforms.resize(), the value range change to [79,179]
I want to do the resize without the change of value range, someone could help? Thank you