From b30bdde15a841b2918f7ef8125f1afd3672a322d Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Mon, 6 Aug 2018 22:15:10 +0800 Subject: [PATCH] random optimize --- paddle/fluid/operators/sampling_id_op.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/sampling_id_op.h b/paddle/fluid/operators/sampling_id_op.h index 7ad25fa13ae..7f3ca8e761c 100644 --- a/paddle/fluid/operators/sampling_id_op.h +++ b/paddle/fluid/operators/sampling_id_op.h @@ -72,11 +72,11 @@ class SamplingIdKernel : public framework::OpKernel { // Standard mersenne_twister_engine seeded with rd() std::mt19937 gen(rd()); std::uniform_real_distribution<> dis(0, 1); - rnd = std::bind(dis, gen); + rnd = std::bind(dis, std::ref(gen)); } static std::once_flag init_flag_; - static std::function<> rnd; + static std::function rnd; }; } // namespace operators } // namespace paddle -- GitLab