From c24da0d3eefa1cf0a9dcee9b96fa120ca2e421b3 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Fri, 12 Jan 2018 16:30:45 +0800 Subject: [PATCH] update unit test split var --- python/paddle/v2/fluid/tests/CMakeLists.txt | 1 + .../paddle/v2/fluid/tests/book_distribute/test_split_var.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/paddle/v2/fluid/tests/CMakeLists.txt b/python/paddle/v2/fluid/tests/CMakeLists.txt index e795627bfe..9a0240cbf6 100644 --- a/python/paddle/v2/fluid/tests/CMakeLists.txt +++ b/python/paddle/v2/fluid/tests/CMakeLists.txt @@ -5,3 +5,4 @@ foreach(src ${TEST_OPS}) endforeach() add_subdirectory(book) +add_subdirectory(book_distribute) diff --git a/python/paddle/v2/fluid/tests/book_distribute/test_split_var.py b/python/paddle/v2/fluid/tests/book_distribute/test_split_var.py index 1355e13e1c..cfb48a5915 100644 --- a/python/paddle/v2/fluid/tests/book_distribute/test_split_var.py +++ b/python/paddle/v2/fluid/tests/book_distribute/test_split_var.py @@ -2,6 +2,7 @@ import math import unittest from paddle.v2.fluid.distribute_transpiler import split_dense_variable import paddle.v2.fluid as fluid +import paddle.v2.fluid.core as core import random @@ -19,9 +20,9 @@ class TestSplitVar(unittest.TestCase): program = fluid.Program() for shape in shapes: var = program.global_block().create_var( - name=str(random.randint(10000)), + name=str(random.randint(10000, 99999)), persistable=True, - dtype=core.VarDesc.VarType.LOD_TENSOR, + # dtype=core.VarDesc.VarType.LOD_TENSOR, shape=shape) var_list.append(var) blocks = split_dense_variable(var_list, 10) -- GitLab