提交 885275ee 编写于 作者: Z Zhaolong Xing 提交者: GitHub

Update ParameterUpdaterHook.cpp

上级 a3ada68a
......@@ -70,10 +70,8 @@ public:
for (size_t i = 0; i < para->getSize(); i++)
param.push_back(std::make_pair(fabs(vecCpu->getData()[i]), i));
std::partial_sort(param.begin(),
param.begin() + nonZeroNum,
param.end(),
sortPairAscend);
std::partial_sort(
param.begin(), param.begin() + nonZeroNum, param.end(), sortPairAscend);
for (size_t i = 0; i < nonZeroNum; i++) dataPtr[param[i].second] = 1.0;
// Currently just use a mask vector for hack.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册