Commit 13d1a6cc authored by vfdev's avatar vfdev Committed by Soumith Chintala
Browse files

Update functional.py (#421)

if on dtype -> elif on dtype
parent f1b79d90
...@@ -115,9 +115,9 @@ def to_pil_image(pic, mode=None): ...@@ -115,9 +115,9 @@ def to_pil_image(pic, mode=None):
npimg = npimg[:, :, 0] npimg = npimg[:, :, 0]
if npimg.dtype == np.uint8: if npimg.dtype == np.uint8:
expected_mode = 'L' expected_mode = 'L'
if npimg.dtype == np.int16: elif npimg.dtype == np.int16:
expected_mode = 'I;16' expected_mode = 'I;16'
if npimg.dtype == np.int32: elif npimg.dtype == np.int32:
expected_mode = 'I' expected_mode = 'I'
elif npimg.dtype == np.float32: elif npimg.dtype == np.float32:
expected_mode = 'F' expected_mode = 'F'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment