提交 44d8dea1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Change check, now that the meaning of base has changed.

上级 03022cec
......@@ -1658,8 +1658,15 @@ CudaNdarray_setitem(PyObject *o, PyObject *key, PyObject *value)
//PyErr_SetString(PyExc_RuntimeError, "__getitem__ returned an error");
return -1;
}
else if((rval != (CudaNdarray*)o && rval->data_allocated) ||
(rval != (CudaNdarray*)o && rval->base != o))
else if(rval != (CudaNdarray*)o &&
(rval->data_allocated ||
// The new array should have a base
!(((CudaNdarray*)rval)->base) ||
// If the original array has no base, the base of the new
// array should be the original one
(!((CudaNdarray*)o)->base && ((CudaNdarray*)rval)->base != o)
// Else, the two arrays should have the same base
|| ((CudaNdarray*)rval)->base != ((CudaNdarray*)o)->base))
{
// This case shouldn't happen, based on what I see in Subscript
// but just in case it happens sometime in the future
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论