Skip to content
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

《如何写新的operator》更新 #132

Closed
shanyi15 opened this issue Oct 11, 2018 · 1 comment · Fixed by #136
Closed

《如何写新的operator》更新 #132

shanyi15 opened this issue Oct 11, 2018 · 1 comment · Fixed by #136
Assignees

Comments

@shanyi15
Copy link
Contributor

shanyi15 commented Oct 11, 2018

这篇文档需要优化:

image

红框处加下面这段话:

Op的输入和输出可分别通过ExecutionContext::Input()和ExecutionContext::Output()获得。注意:若op的输入/输出的变量类型是LoDTensor(fluid默认所有的Tensor默认都是LoDTensor类型),请写成ExecutionContext::Input()和ExecutionContext::Output(),不要写ExecutionContext::Input()和ExecutionContext::Output()。因为若实际的变量类型为SelectedRows,Input()和Output()方法会将SelectedRows类型特化为Tensor,导致潜在的错误。

image
上图红框处,加代码注释:never use Input or Output if you want a to get a LoDTensor.

image
image
上图红框里,把 Tensor 改成 LoDTensor ,共6处

@shanyi15
Copy link
Contributor Author

需要1.0上线 @tink2123 辛苦~

tink2123 added a commit that referenced this issue Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants