Commit b1fb79f9 authored by Surgan Jandial's avatar Surgan Jandial Committed by Francisco Massa
Browse files

minor improvments (#874)

parent c0c696fd
......@@ -35,10 +35,8 @@ def is_image_file(filename):
def make_dataset(dir, class_to_idx, extensions=None, is_valid_file=None):
images = []
dir = os.path.expanduser(dir)
if extensions is None and is_valid_file is None:
raise ValueError("Both extensions and is_valid_file cannot be None")
if extensions is not None and is_valid_file is not None:
raise ValueError("One of the extensions and is_valid_file should be None")
if not ((extensions is None) ^ (is_valid_file is None)):
raise ValueError("Both extensions and is_valid_file cannot be None or not None at the same time")
if extensions is not None:
def is_valid_file(x):
return has_file_allowed_extension(x, extensions)
......
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