We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f121ca7 + 00c119c commit 189cbc8Copy full SHA for 189cbc8
torchvision/transforms/functional_tensor.py
@@ -46,15 +46,15 @@ def get_image_num_channels(img: Tensor) -> int:
46
47
def _max_value(dtype: torch.dtype) -> int:
48
if dtype == torch.uint8:
49
- return int(2 ** 8) - 1
+ return 255
50
elif dtype == torch.int8:
51
- return int(2 ** 7) - 1
+ return 127
52
elif dtype == torch.int16:
53
- return int(2 ** 15) - 1
+ return 32767
54
elif dtype == torch.int32:
55
- return int(2 ** 31) - 1
+ return 2147483647
56
elif dtype == torch.int64:
57
- return int(2 ** 63) - 1
+ return 9223372036854775807
58
else:
59
return 1
60
0 commit comments