提交 6a05ed33 编写于 作者: C chenweihang

fix: add batch size check in loading data process

上级 56b50ee4
......@@ -40,4 +40,9 @@ def batch(reader, batch_size, drop_last=False):
if drop_last == False and len(b) != 0:
yield b
# Batch size check
if batch_size <= 0:
raise ValueError("batch_size should be a positive integeral value, "
"but got batch_size={}".format(batch_size))
return batch_reader
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册