Commit 182f9bf4 by liyinqiao

Bug fixed:

When we do the "=" operation, the link will be copy to the new tensor instead of replace it.
parent 0976ca02
......@@ -397,7 +397,7 @@ XTensor& XTensor::operator= (const XTensor& tensor)
CheckNTErrors(outgo.tailNum == 0, "The node has outgoing edge to other nodes!");
/* create tensor links for the new tensor */
XLink::Replace(&tensor, this);
XLink::Copy(&tensor, this);
}
return *this;
......@@ -445,7 +445,7 @@ XTensor& XTensor::operator= (const XTensor&& tensor)
This is VERY tricky and there might be better solutions :) */
*tensor.dataP = NULL;
XLink::Replace(&tensor, this);
XLink::Copy(&tensor, this);
return *this;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论