diff --git a/paddle/operators/random_op.cc b/paddle/operators/random_op.cc index a536ee74b403b01c0ae1baa3a6077c7404118a41..05a3dbd9f44907e3d9c41546cbd5e86ae127d8c4 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 40b642d8a199755fa120f8154b90d06a310fd398..85054974ac389f40e481a909aa28e943abd75419 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 fd1a142b40e19d257505f0465ce6c7a62e5cbc35..8010369b410e7dc5bebdb63bec981fcfd90235a3 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 f6e90134712f6f6a71d7c8ea1eeecf7107fbb4d7..1138b07ec4a2cd6c3026cca5ab24dea7ac04420f 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) {