提交 48173e85 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #5010 from tensor-tang/merge

fix crash on ds2
......@@ -339,11 +339,15 @@ private:
* clear all grad
*/
void clearGrads() {
if (output_.grad) {
output_.grad->zeroMem();
}
for (size_t i = 0; i < outputOtherDevice_.size(); i++) {
if (outputOtherDevice_[i].grad) {
outputOtherDevice_[i].grad->zeroMem();
}
}
}
/**
* Set deviceId of the params used in this layer.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册