From bcc2fbe6877f2b325c020d3a7c7ff1344ea777a0 Mon Sep 17 00:00:00 2001 From: chenweihang Date: Wed, 1 Aug 2018 05:18:55 +0000 Subject: [PATCH] add type conversion for batch_size --- python/paddle/batch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/paddle/batch.py b/python/paddle/batch.py index 2ba45c81646..00850966073 100644 --- a/python/paddle/batch.py +++ b/python/paddle/batch.py @@ -41,6 +41,7 @@ def batch(reader, batch_size, drop_last=False): 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)) -- GitLab