未验证 提交 af8a041b 编写于 作者: Z Zeng Jinle 提交者: GitHub

reduce py_reader unittest time (#16996)

test=develop
上级 45ebafc3
...@@ -21,12 +21,13 @@ import unittest ...@@ -21,12 +21,13 @@ import unittest
EPOCH_NUM = 20 EPOCH_NUM = 20
BATCH_SIZE = 32 BATCH_SIZE = 32
BATCH_NUM = 20
CLASS_NUM = 10 CLASS_NUM = 10
def random_reader(): def random_reader():
np.random.seed(1) np.random.seed(1)
for i in range(BATCH_SIZE * 40): for i in range(BATCH_SIZE * BATCH_NUM):
image = np.random.random([784]) image = np.random.random([784])
label = np.random.random_integers(low=0, high=CLASS_NUM - 1) label = np.random.random_integers(low=0, high=CLASS_NUM - 1)
yield image, label yield image, label
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册