Merge pull request #25 from cclauss/patch-1

Use ==/!= to compare constant literals (str, bytes, int, float, tuple)
pull/28/head
Shawn Shan 2020-07-24 16:38:23 -05:00 zatwierdzone przez GitHub
commit edd7df5dc6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -1,3 +1,4 @@
import errno
import glob
import gzip
import json
@ -242,9 +243,9 @@ def fix_gpu_memory(mem_fraction=1):
def preprocess(X, method):
assert method in {'raw', 'imagenet', 'inception', 'mnist'}
if method is 'raw':
if method == 'raw':
pass
elif method is 'imagenet':
elif method == 'imagenet':
X = imagenet_preprocessing(X)
else:
raise Exception('unknown method %s' % method)
@ -255,9 +256,9 @@ def preprocess(X, method):
def reverse_preprocess(X, method):
assert method in {'raw', 'imagenet', 'inception', 'mnist'}
if method is 'raw':
if method == 'raw':
pass
elif method is 'imagenet':
elif method == 'imagenet':
X = imagenet_reverse_preprocessing(X)
else:
raise Exception('unknown method %s' % method)