Skip to content

Commit 189cbc8

Browse files
authored
Merge branch 'main' into multiweight
2 parents f121ca7 + 00c119c commit 189cbc8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

torchvision/transforms/functional_tensor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ def get_image_num_channels(img: Tensor) -> int:
4646

4747
def _max_value(dtype: torch.dtype) -> int:
4848
if dtype == torch.uint8:
49-
return int(2 ** 8) - 1
49+
return 255
5050
elif dtype == torch.int8:
51-
return int(2 ** 7) - 1
51+
return 127
5252
elif dtype == torch.int16:
53-
return int(2 ** 15) - 1
53+
return 32767
5454
elif dtype == torch.int32:
55-
return int(2 ** 31) - 1
55+
return 2147483647
5656
elif dtype == torch.int64:
57-
return int(2 ** 63) - 1
57+
return 9223372036854775807
5858
else:
5959
return 1
6060

0 commit comments

Comments
 (0)