提交 41096467 authored 作者: Yann N. Dauphin's avatar Yann N. Dauphin

fix memory access problem in CSMGradC

上级 8e633dca
......@@ -867,7 +867,10 @@ class CSMGradC(gof.Op):
dtype_%(b_val)s b_row[sp_dim];
//clear the output array
memset(Dz, 0, nnz*sizeof(dtype_%(z)s));
for (npy_int64 i = 0; i < nnz; ++i)
{
Dz[i*Sz] = 0;
}
memset(b_row, 0, sp_dim*sizeof(dtype_%(b_val)s));
// loop over inner dimension
......@@ -893,7 +896,7 @@ class CSMGradC(gof.Op):
""" % dict(locals(), **sub)
def c_code_cache_version(self):
return (2,)
return (3,)
csm_grad_c = CSMGradC()
@gof.local_optimizer([csm_grad(None)])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论