Browse Source

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

tags/v1.6.0
zhangzhaoju 4 years ago
parent
commit
6685ed95ea
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      mindspore/common/tensor.py

+ 3
- 2
mindspore/common/tensor.py 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):


Loading…
Cancel
Save