Skip to content

Commit 13d1a6c

Browse files
vfdev-5soumith
authored andcommitted
Update functional.py (#421)
if on dtype -> elif on dtype
1 parent f1b79d9 commit 13d1a6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/transforms/functional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def to_pil_image(pic, mode=None):
115115
npimg = npimg[:, :, 0]
116116
if npimg.dtype == np.uint8:
117117
expected_mode = 'L'
118-
if npimg.dtype == np.int16:
118+
elif npimg.dtype == np.int16:
119119
expected_mode = 'I;16'
120-
if npimg.dtype == np.int32:
120+
elif npimg.dtype == np.int32:
121121
expected_mode = 'I'
122122
elif npimg.dtype == np.float32:
123123
expected_mode = 'F'

0 commit comments

Comments
 (0)