提交 fe3995d3 编写于 作者: Q Qiao Longfei

refine code test=develop

上级 56686d0f
...@@ -227,7 +227,9 @@ struct SparseAdamFunctor { ...@@ -227,7 +227,9 @@ struct SparseAdamFunctor {
inline HOSTDEVICE void operator()(size_t i) const { inline HOSTDEVICE void operator()(size_t i) const {
auto row_idx = auto row_idx =
math::BinarySearch<int64_t>(rows_, row_count_, i / row_numel_); math::BinarySearch<int64_t>(rows_, row_count_, i / row_numel_);
if (!(lazy_mode_ && row_idx < 0)) { if (lazy_mode_ && row_idx < 0) {
return;
} else {
T g = row_idx >= 0 ? grad_[row_idx * row_numel_ + i % row_numel_] : 0; T g = row_idx >= 0 ? grad_[row_idx * row_numel_ + i % row_numel_] : 0;
adam_update(i, g); adam_update(i, g);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册