提交 30a47fe8 编写于 作者: D dongzhihong

"link pybind11"

上级 32c15a29
...@@ -71,10 +71,10 @@ The eqution : Out = Random(Shape=(d0, d1, ...), Dtype, mean, std) ...@@ -71,10 +71,10 @@ The eqution : Out = Random(Shape=(d0, d1, ...), Dtype, mean, std)
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
REGISTER_OP(random_op, REGISTER_OP(random,
paddle::operators::RandomOp, paddle::operators::RandomOp,
paddle::operators::RandomOpMaker); paddle::operators::RandomOpMaker);
typedef paddle::operators::RandomOpKernel<paddle::platform::CPUPlace, float> typedef paddle::operators::RandomOpKernel<paddle::platform::CPUPlace, float>
RandomOpKernel_CPU_float; RandomOpKernel_CPU_float;
REGISTER_OP_CPU_KERNEL(random_op, RandomOpKernel_CPU_float); REGISTER_OP_CPU_KERNEL(random, RandomOpKernel_CPU_float);
...@@ -17,4 +17,4 @@ bool Gaussian(platform::CUDADeviceContext &ctx, framework::Tensor* output, ...@@ -17,4 +17,4 @@ bool Gaussian(platform::CUDADeviceContext &ctx, framework::Tensor* output,
typedef paddle::operators::RandomOpKernel<paddle::platform::GPUPlace, float> typedef paddle::operators::RandomOpKernel<paddle::platform::GPUPlace, float>
RandomOpKernel_GPU_float; RandomOpKernel_GPU_float;
REGISTER_OP_GPU_KERNEL(random_op, RandomOpKernel_GPU_float); REGISTER_OP_GPU_KERNEL(random, RandomOpKernel_GPU_float);
\ No newline at end of file \ No newline at end of file
cc_library(paddle_pybind SHARED SRCS pybind.cc DEPS pybind python 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)
...@@ -36,7 +36,7 @@ USE_OP(mul); ...@@ -36,7 +36,7 @@ USE_OP(mul);
USE_OP(sigmoid); USE_OP(sigmoid);
USE_OP(softmax); USE_OP(softmax);
USE_OP(rowwise_add); USE_OP(rowwise_add);
USE_OP(random_op); USE_OP(random);
template <typename ClassType> template <typename ClassType>
void ExposeOperator(ClassType& m) { void ExposeOperator(ClassType& m) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册