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):
192
192
self .isSeq = True
193
193
194
194
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
196
205
self .isSeq = False
197
206
elif isinstance (idx , ParallelRange ):
198
207
self .idx .seq = idx
199
208
self .isBatch = True
200
209
else :
201
210
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 66
66
for r in rows :
67
67
af .display (r )
68
68
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