From 30a47fe8a321fd92b05fcf71e3668862176d1f91 Mon Sep 17 00:00:00 2001 From: dongzhihong Date: Tue, 25 Jul 2017 15:19:13 +0800 Subject: [PATCH] "link pybind11" --- paddle/operators/random_op.cc | 4 ++-- paddle/operators/random_op.cu | 2 +- paddle/pybind/CMakeLists.txt | 2 +- paddle/pybind/pybind.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/operators/random_op.cc b/paddle/operators/random_op.cc index a536ee74b4..05a3dbd9f4 100644 --- a/paddle/operators/random_op.cc +++ b/paddle/operators/random_op.cc @@ -71,10 +71,10 @@ The eqution : Out = Random(Shape=(d0, d1, ...), Dtype, mean, std) } // namespace operators } // namespace paddle -REGISTER_OP(random_op, +REGISTER_OP(random, paddle::operators::RandomOp, paddle::operators::RandomOpMaker); typedef paddle::operators::RandomOpKernel RandomOpKernel_CPU_float; -REGISTER_OP_CPU_KERNEL(random_op, RandomOpKernel_CPU_float); +REGISTER_OP_CPU_KERNEL(random, RandomOpKernel_CPU_float); diff --git a/paddle/operators/random_op.cu b/paddle/operators/random_op.cu index 40b642d8a1..85054974ac 100644 --- a/paddle/operators/random_op.cu +++ b/paddle/operators/random_op.cu @@ -17,4 +17,4 @@ bool Gaussian(platform::CUDADeviceContext &ctx, framework::Tensor* output, typedef paddle::operators::RandomOpKernel RandomOpKernel_GPU_float; -REGISTER_OP_GPU_KERNEL(random_op, RandomOpKernel_GPU_float); \ No newline at end of file +REGISTER_OP_GPU_KERNEL(random, RandomOpKernel_GPU_float); \ No newline at end of file diff --git a/paddle/pybind/CMakeLists.txt b/paddle/pybind/CMakeLists.txt index fd1a142b40..8010369b41 100644 --- a/paddle/pybind/CMakeLists.txt +++ b/paddle/pybind/CMakeLists.txt @@ -1,2 +1,2 @@ cc_library(paddle_pybind SHARED SRCS pybind.cc DEPS pybind python - add_op fc_op sgd_op cross_entropy_op) + add_op fc_op sgd_op cross_entropy_op random_op) diff --git a/paddle/pybind/pybind.cc b/paddle/pybind/pybind.cc index f6e9013471..1138b07ec4 100644 --- a/paddle/pybind/pybind.cc +++ b/paddle/pybind/pybind.cc @@ -36,7 +36,7 @@ USE_OP(mul); USE_OP(sigmoid); USE_OP(softmax); USE_OP(rowwise_add); -USE_OP(random_op); +USE_OP(random); template void ExposeOperator(ClassType& m) {