🐛 Describe the bug
The current code is: pic = pic.mul(255).byte().
If the input is, say, 0.9999, this will be rounded down to 254 instead of 255.
>>> torch.as_tensor([0.9999]).mul(255).byte().item()
254
I would suggest that the code be: pic = pic.mul(255).round().byte():
>>> torch.as_tensor([0.9999]).mul(255).round().byte().item()
255
Versions
N/A
🐛 Describe the bug
The current code is:
pic = pic.mul(255).byte().If the input is, say, 0.9999, this will be rounded down to 254 instead of 255.
I would suggest that the code be:
pic = pic.mul(255).round().byte():Versions
N/A