提交 c24da0d3 编写于 作者: T typhoonzero

update unit test split var

上级 5faebab3
...@@ -5,3 +5,4 @@ foreach(src ${TEST_OPS}) ...@@ -5,3 +5,4 @@ foreach(src ${TEST_OPS})
endforeach() endforeach()
add_subdirectory(book) add_subdirectory(book)
add_subdirectory(book_distribute)
...@@ -2,6 +2,7 @@ import math ...@@ -2,6 +2,7 @@ import math
import unittest import unittest
from paddle.v2.fluid.distribute_transpiler import split_dense_variable from paddle.v2.fluid.distribute_transpiler import split_dense_variable
import paddle.v2.fluid as fluid import paddle.v2.fluid as fluid
import paddle.v2.fluid.core as core
import random import random
...@@ -19,9 +20,9 @@ class TestSplitVar(unittest.TestCase): ...@@ -19,9 +20,9 @@ class TestSplitVar(unittest.TestCase):
program = fluid.Program() program = fluid.Program()
for shape in shapes: for shape in shapes:
var = program.global_block().create_var( var = program.global_block().create_var(
name=str(random.randint(10000)), name=str(random.randint(10000, 99999)),
persistable=True, persistable=True,
dtype=core.VarDesc.VarType.LOD_TENSOR, # dtype=core.VarDesc.VarType.LOD_TENSOR,
shape=shape) shape=shape)
var_list.append(var) var_list.append(var)
blocks = split_dense_variable(var_list, 10) blocks = split_dense_variable(var_list, 10)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册