|
|
@ -42,7 +42,7 @@ class GPUGaussianRandomKernel : public framework::OpKernel {
|
|
|
|
void Compute(const framework::ExecutionContext& context) const override {
|
|
|
|
void Compute(const framework::ExecutionContext& context) const override {
|
|
|
|
auto* tensor = context.Output<framework::Tensor>("Out");
|
|
|
|
auto* tensor = context.Output<framework::Tensor>("Out");
|
|
|
|
T* data = tensor->mutable_data<T>(context.GetPlace());
|
|
|
|
T* data = tensor->mutable_data<T>(context.GetPlace());
|
|
|
|
unsigned int seed = static_cast<unsigned int>(context.GetAttr<int>("seed"));
|
|
|
|
unsigned int seed = static_cast<unsigned int>(context.Attr<int>("seed"));
|
|
|
|
if (seed == 0) {
|
|
|
|
if (seed == 0) {
|
|
|
|
std::random_device rd;
|
|
|
|
std::random_device rd;
|
|
|
|
seed = rd();
|
|
|
|
seed = rd();
|
|
|
|