Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 0669d98

Browse files
committed
revert changes in dufunc to allow tests to pass
1 parent e074a4a commit 0669d98

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

numba/dppy/dufunc_inliner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _run_inliner(func_ir, sig, template, arg_typs, expr, i, py_func, block,
2121
return True
2222

2323

24-
def _inline(func_ir, work_list, block, i, expr,py_func, typemap, calltypes,
24+
def _inline(func_ir, work_list, block, i, expr, py_func, typemap, calltypes,
2525
typingctx):
2626
# try and get a definition for the call, this isn't always possible as
2727
# it might be a eval(str)/part generated awaiting update etc. (parfors)
@@ -91,7 +91,7 @@ def dufunc_inliner(func_ir, calltypes, typemap, typingctx):
9191
if isinstance(expr, ir.Expr):
9292
call_node = _is_dufunc_callsite(expr, block)
9393
if call_node:
94-
py_func = call_node.value.py_func
94+
py_func = call_node.value._dispatcher.py_func
9595
workfn = _inline(func_ir, work_list, block, i, expr,
9696
py_func, typemap, calltypes, typingctx)
9797
if workfn:

numba/np/ufunc/dufunc.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ class DUFunc(_internal._DUFunc):
7676
# _internal.c:dufunc_init()
7777
__base_kwargs = set(('identity', '_keepalive', 'nin', 'nout'))
7878

79-
8079
def __init__(self, py_func, identity=None, cache=False, targetoptions={}):
81-
self.py_func = py_func
8280
if isinstance(py_func, Dispatcher):
8381
py_func = py_func.py_func
8482
dispatcher = jit(target='npyufunc',
@@ -101,18 +99,17 @@ def __reduce__(self):
10199
siglist = list(self._dispatcher.overloads.keys())
102100
return (serialize._rebuild_reduction,
103101
(self.__class__, self._dispatcher, self.identity,
104-
self._frozen, siglist, self.py_func))
102+
self._frozen, siglist))
105103

106104
@classmethod
107-
def _rebuild(cls, dispatcher, identity, frozen, siglist, py_func):
105+
def _rebuild(cls, dispatcher, identity, frozen, siglist):
108106
self = _internal._DUFunc.__new__(cls)
109107
self._initialize(dispatcher, identity)
110108
# Re-add signatures
111109
for sig in siglist:
112110
self.add(sig)
113111
if frozen:
114112
self.disable_compile()
115-
self.py_func = py_func
116113
return self
117114

118115
def build_ufunc(self):

0 commit comments

Comments
 (0)