@@ -299,7 +299,7 @@ def accum(a, dim=0):
299299 """
300300 return _parallel_dim (a , dim , backend .get ().af_accum )
301301
302- def scan (a , dim = 0 , op = BINARYOP .BINARY_ADD , inclusive_scan = True ):
302+ def scan (a , dim = 0 , op = BINARYOP .ADD , inclusive_scan = True ):
303303 """
304304 Generalized scan of an array.
305305
@@ -311,8 +311,12 @@ def scan(a, dim=0, op=BINARYOP.BINARY_ADD, inclusive_scan=True):
311311 dim : optional: int. default: 0
312312 Dimension along which the scan is performed.
313313
314- op : optional: af.BINARYOP. default: af.BINARYOP.BINARY_ADD.
315- - Interpolation method used for resizing.
314+ op : optional: af.BINARYOP. default: af.BINARYOP.ADD.
315+ Binary option the scan algorithm uses. Can be one of:
316+ - af.BINARYOP.ADD
317+ - af.BINARYOP.MUL
318+ - af.BINARYOP.MIN
319+ - af.BINARYOP.MAX
316320
317321 inclusive_scan: optional: bool. default: True
318322 Specifies if the scan is inclusive
@@ -323,10 +327,10 @@ def scan(a, dim=0, op=BINARYOP.BINARY_ADD, inclusive_scan=True):
323327 - will contain scan of input.
324328 """
325329 out = Array ()
326- safe_call (backend .get ().af_scan (ct .pointer (out .arr ), a .arr , dim , op , inclusive_scan ))
330+ safe_call (backend .get ().af_scan (ct .pointer (out .arr ), a .arr , dim , op . value , inclusive_scan ))
327331 return out
328332
329- def scan_by_key (key , a , dim = 0 , op = BINARYOP .BINARY_ADD , inclusive_scan = True ):
333+ def scan_by_key (key , a , dim = 0 , op = BINARYOP .ADD , inclusive_scan = True ):
330334 """
331335 Generalized scan by key of an array.
332336
@@ -341,8 +345,12 @@ def scan_by_key(key, a, dim=0, op=BINARYOP.BINARY_ADD, inclusive_scan=True):
341345 dim : optional: int. default: 0
342346 Dimension along which the scan is performed.
343347
344- op : optional: af.BINARYOP. default: af.BINARYOP.BINARY_ADD.
345- - Interpolation method used for resizing.
348+ op : optional: af.BINARYOP. default: af.BINARYOP.ADD.
349+ Binary option the scan algorithm uses. Can be one of:
350+ - af.BINARYOP.ADD
351+ - af.BINARYOP.MUL
352+ - af.BINARYOP.MIN
353+ - af.BINARYOP.MAX
346354
347355 inclusive_scan: optional: bool. default: True
348356 Specifies if the scan is inclusive
@@ -353,7 +361,7 @@ def scan_by_key(key, a, dim=0, op=BINARYOP.BINARY_ADD, inclusive_scan=True):
353361 - will contain scan of input.
354362 """
355363 out = Array ()
356- safe_call (backend .get ().af_scan_by_key (ct .pointer (out .arr ), key .arr , a .arr , dim , op , inclusive_scan ))
364+ safe_call (backend .get ().af_scan_by_key (ct .pointer (out .arr ), key .arr , a .arr , dim , op . value , inclusive_scan ))
357365 return out
358366
359367def where (a ):
0 commit comments