Skip to content

Commit b30bdde

Browse files
committed
random optimize
1 parent 9c63fef commit b30bdde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/fluid/operators/sampling_id_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ class SamplingIdKernel : public framework::OpKernel<T> {
7272
// Standard mersenne_twister_engine seeded with rd()
7373
std::mt19937 gen(rd());
7474
std::uniform_real_distribution<> dis(0, 1);
75-
rnd = std::bind(dis, gen);
75+
rnd = std::bind(dis, std::ref(gen));
7676
}
7777

7878
static std::once_flag init_flag_;
79-
static std::function<> rnd;
79+
static std::function<double()> rnd;
8080
};
8181
} // namespace operators
8282
} // namespace paddle

0 commit comments

Comments
 (0)