From 848c317aa84aea797654a3f0ee7a2db0fb0e8d09 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Sat, 2 Sep 2017 14:13:05 -0700 Subject: [PATCH] update gpu code --- paddle/operators/gaussian_random_op.cu | 6 +++--- paddle/operators/uniform_random_op.cu | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/paddle/operators/gaussian_random_op.cu b/paddle/operators/gaussian_random_op.cu index 018a4bfcb2..9769fbcd2b 100644 --- a/paddle/operators/gaussian_random_op.cu +++ b/paddle/operators/gaussian_random_op.cu @@ -43,13 +43,13 @@ class GPUGaussianRandomKernel : public framework::OpKernel { auto* tensor = context.Output("Out"); T* data = tensor->mutable_data(context.GetPlace()); unsigned int seed = - static_cast(context.op_.GetAttr("seed")); + static_cast(context.op().GetAttr("seed")); if (seed == 0) { std::random_device rd; seed = rd(); } - T mean = static_cast(context.op_.GetAttr("mean")); - T std = static_cast(context.op_.GetAttr("std")); + T mean = static_cast(context.op().GetAttr("mean")); + T std = static_cast(context.op().GetAttr("std")); thrust::counting_iterator index_sequence_begin(0); ssize_t N = framework::product(tensor->dims()); thrust::transform(index_sequence_begin, index_sequence_begin + N, diff --git a/paddle/operators/uniform_random_op.cu b/paddle/operators/uniform_random_op.cu index 1d6709934c..fc8397f134 100644 --- a/paddle/operators/uniform_random_op.cu +++ b/paddle/operators/uniform_random_op.cu @@ -46,13 +46,13 @@ class GPUUniformRandomKernel : public framework::OpKernel { auto* tensor = context.Output("Out"); T* data = tensor->mutable_data(context.GetPlace()); unsigned int seed = - static_cast(context.op_.GetAttr("seed")); + static_cast(context.op().GetAttr("seed")); if (seed == 0) { std::random_device rd; seed = rd(); } - T min = static_cast(context.op_.GetAttr("min")); - T max = static_cast(context.op_.GetAttr("max")); + T min = static_cast(context.op().GetAttr("min")); + T max = static_cast(context.op().GetAttr("max")); thrust::counting_iterator index_sequence_begin(0); ssize_t N = framework::product(tensor->dims()); thrust::transform(index_sequence_begin, index_sequence_begin + N, -- GitLab