ai-content-maker/.venv/Lib/site-packages/numba/cuda/simulator/reduction.py

16 lines
300 B
Python
Raw Normal View History

2024-05-03 04:18:51 +03:00
from functools import reduce as pyreduce
def Reduce(func):
def reduce_wrapper(seq, res=None, init=0):
r = pyreduce(func, seq, init)
if res is not None:
res[0] = r
return None
else:
return r
return reduce_wrapper
reduce = Reduce