提交 bcc2fbe6 编写于 作者: C chenweihang

add type conversion for batch_size

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