Fix infinite loop while tensor augassign using '...' as index

This commit is contained in:
zhangzhaoju 2021-10-29 14:49:15 +08:00
parent 958c2a8e00
commit 6685ed95ea
1 changed files with 3 additions and 2 deletions

View File

@ -252,8 +252,9 @@ class Tensor(Tensor_):
def __getitem__(self, index):
out = tensor_operator_registry.get('__getitem__')(self, index)
out.parent_tensor_ = self
out.index_of_parent_ = index
if out is not self:
out.parent_tensor_ = self
out.index_of_parent_ = index
return out
def __setitem__(self, index, value):