-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update the doc for how to write the operators. #3873
Conversation
lcy-seso
commented
Sep 5, 2017
•
edited
Loading
edited
- 之前部分代码段没有设置格式,所以没有启用高亮。
- 编译方式发生变化。
- CMakeLists.txt 一部分是按照 *_op.cc 这样的命名方式来添加源码,按照自己理解修改了一些。
doc/howto/dev/new_op_cn.md
Outdated
|
||
下面命令可以编译: | ||
|
||
无需修改[paddle/operators/CMakeLists.txt](/~https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/CMakeLists.txt)文件,`paddle/operators` 目录下新增的 `*_op.cc` 文件会被自动加入编译。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是DEPS的op,需要改cmakelists.txt。不过cmake这块还在修改和完善,这里先这样写着也可以。或者说明一下:没有DEPS的op自动加入编译。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. thank you.
doc/howto/dev/new_op_cn.md
Outdated
@@ -310,7 +297,7 @@ class TestMulOp(unittest.TestCase): | |||
- 第四个参数`"Out"` : 指定前向网络最终的输出目标变量`Out` | |||
|
|||
|
|||
### 编译和执行 | |||
### 编译和执行 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面308行,能否帮忙改成:
编译时需要打开WITH_TESTING
, 即 cmake paddle_dir -DWITH_TESTING=ON
,请注意,运行单测时的需要编译整个工程,不同于上述Op的编译测试,编译成功之后执行单测命令为:
主要是为了和Op里的编译测试区分开,上述Op里编译,可以只编译单独的一个文件,方便测试。 这里Python测试需要生成core.so,需要编译整个工程。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM