Skip to content

Commit 6a05ed3

Browse files
committed
fix: add batch size check in loading data process
1 parent 56b50ee commit 6a05ed3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/paddle/batch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,9 @@ def batch_reader():
4040
if drop_last == False and len(b) != 0:
4141
yield b
4242

43+
# Batch size check
44+
if batch_size <= 0:
45+
raise ValueError("batch_size should be a positive integeral value, "
46+
"but got batch_size={}".format(batch_size))
47+
4348
return batch_reader

0 commit comments

Comments
 (0)