File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,24 @@ def __init__ (self, idx):
192192 self .isSeq = True
193193
194194 if isinstance (idx , BaseArray ):
195- self .idx .arr = idx .arr
195+
196+ arr = ct .c_void_p (0 )
197+
198+ if (Enum_value (idx .dtype ()) ==
199+ Enum_value (Dtype .b8 )):
200+ safe_call (backend .get ().af_where (ct .pointer (arr ), idx .arr ))
201+ else :
202+ safe_call (backend .get ().af_retain_array (ct .pointer (arr ), idx .arr ))
203+
204+ self .idx .arr = arr
196205 self .isSeq = False
197206 elif isinstance (idx , ParallelRange ):
198207 self .idx .seq = idx
199208 self .isBatch = True
200209 else :
201210 self .idx .seq = Seq (idx )
211+
212+ # def __del__(self):
213+ # if not self.isSeq:
214+ # arr = self.idx.arr
215+ # backend.get().af_release_array(arr)
Original file line number Diff line number Diff line change 6666for r in rows :
6767 af .display (r )
6868 af .display (b [:,r ])
69+
70+ a = af .randu (3 )
71+ c = af .randu (3 )
72+ b = af .constant (1 ,3 ,dtype = af .Dtype .b8 )
73+ af .display (a )
74+ a [b ] = c
75+ af .display (a )
You can’t perform that action at this time.
0 commit comments