From dc57952b7f44ee5b5c9f2535ef2f1e8e6d14cf4a Mon Sep 17 00:00:00 2001 From: ceci3 <592712189@qq.com> Date: Wed, 6 Mar 2019 05:50:47 +0000 Subject: [PATCH] test=develop, add random to testfile --- paddle/fluid/API.spec | 2 +- python/paddle/fluid/tests/unittests/test_npair_loss_op.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index cfa4f6804a..819a76e16e 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -221,7 +221,7 @@ paddle.fluid.layers.psroi_pool (ArgSpec(args=['input', 'rois', 'output_channels' paddle.fluid.layers.teacher_student_sigmoid_loss (ArgSpec(args=['input', 'label', 'soft_max_up_bound', 'soft_max_lower_bound'], varargs=None, keywords=None, defaults=(15.0, -15.0)), ('document', '2f6ff96864054a31aa4bb659c6722c99')) paddle.fluid.layers.huber_loss (ArgSpec(args=['input', 'label', 'delta'], varargs=None, keywords=None, defaults=None), ('document', '431a4301c35032166ec029f7432c80a7')) paddle.fluid.layers.tree_conv (ArgSpec(args=['nodes_vector', 'edge_set', 'output_size', 'num_filters', 'max_depth', 'act', 'param_attr', 'bias_attr', 'name'], varargs=None, keywords=None, defaults=(1, 2, 'tanh', None, None, None)), ('document', '34ea12ac9f10a65dccbc50100d12e607')) -paddle.fluid.layers.npair_loss (ArgSpec(args=['anchor', 'positive', 'labels', 'l2_reg'], varargs=None, keywords=None, defaults=(0.002,)), ('document', 'cb0c35513643d9911e95c3194d6933c4')) +paddle.fluid.layers.npair_loss (ArgSpec(args=['anchor', 'positive', 'labels', 'l2_reg'], varargs=None, keywords=None, defaults=(0.002,)), ('document', '7d010db0a2404dfbecb9ba5804788a16')) paddle.fluid.layers.data (ArgSpec(args=['name', 'shape', 'append_batch_size', 'dtype', 'lod_level', 'type', 'stop_gradient'], varargs=None, keywords=None, defaults=(True, 'float32', 0, VarType.LOD_TENSOR, True)), ('document', '33bbd42027d872b3818b3d64ec52e139')) paddle.fluid.layers.open_files (ArgSpec(args=['filenames', 'shapes', 'lod_levels', 'dtypes', 'thread_num', 'buffer_size', 'pass_num', 'is_test'], varargs=None, keywords=None, defaults=(None, None, 1, None)), ('document', 'b1ae2e1cc0750e58726374061ea90ecc')) paddle.fluid.layers.read_file (ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None), ('document', 'b0a1c2fc51c27a106da28f3308c41f5e')) diff --git a/python/paddle/fluid/tests/unittests/test_npair_loss_op.py b/python/paddle/fluid/tests/unittests/test_npair_loss_op.py index 473d1cd431..9868a69e4a 100644 --- a/python/paddle/fluid/tests/unittests/test_npair_loss_op.py +++ b/python/paddle/fluid/tests/unittests/test_npair_loss_op.py @@ -86,8 +86,9 @@ class TestNpairLossOp(unittest.TestCase): shape=[num_data, feat_dim], dtype=self.dtype, append_batch_size=False) + rname = 'labels' + str(np.random.rand()).split('.')[1] labels_tensor = fluid.layers.data( - name='labels', + name=rname, shape=[num_data], dtype=self.dtype, append_batch_size=False) @@ -100,7 +101,7 @@ class TestNpairLossOp(unittest.TestCase): out_tensor = exe.run(feed={ 'anchor': embeddings_anchor, 'positive': embeddings_positive, - 'labels': labels + rname: labels }, fetch_list=[npair_loss_op.name]) -- GitLab