提交 5ed04a09 编写于 作者: C chenjiawen

Merge branch 'develop' of https://github.com/PaddlePaddle/paddle into ce

...@@ -60,6 +60,7 @@ class TopkKernel : public framework::OpKernel<T> { ...@@ -60,6 +60,7 @@ class TopkKernel : public framework::OpKernel<T> {
#endif #endif
for (size_t i = 0; i < row; i++) { for (size_t i = 0; i < row; i++) {
std::vector<std::pair<T, size_t>> vec; std::vector<std::pair<T, size_t>> vec;
vec.reserve(col);
for (size_t j = 0; j < col; j++) { for (size_t j = 0; j < col; j++) {
vec.push_back(std::pair<T, size_t>(eg_input(i, j), j)); vec.push_back(std::pair<T, size_t>(eg_input(i, j), j));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册