Merge pull request #12467 from chenwhql/batch_size_check

fix: add batch size check in loading data process
fea/anakin-support-x86
Chen Weihang 7 years ago committed by GitHub
commit 3185d38af4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,4 +40,10 @@ def batch(reader, batch_size, drop_last=False):
if drop_last == False and len(b) != 0:
yield b
# Batch size check
batch_size = int(batch_size)
if batch_size <= 0:
raise ValueError("batch_size should be a positive integeral value, "
"but got batch_size={}".format(batch_size))
return batch_reader

Loading…
Cancel
Save