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

Patch for change numpy functions mapping #99

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions numba/np/npyimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,7 @@ def __init__(self, context, builder, outer_sig):
super(_KernelImpl, self).__init__(context, builder, outer_sig)
loop = ufunc_find_matching_loop(
ufunc, outer_sig.args + tuple(_unpack_output_types(ufunc, outer_sig)))

if hasattr(context, 'ufunc_db'):
self.fn = context.ufunc_db[ufunc].get(loop.ufunc_sig)
else:
self.fn = ufunc_db.get_ufunc_info(ufunc).get(loop.ufunc_sig)

self.fn = ufunc_db.get_ufunc_info(ufunc).get(loop.ufunc_sig)
self.inner_sig = _ufunc_loop_sig(loop.outputs, loop.inputs)

if self.fn is None:
Expand Down
5 changes: 2 additions & 3 deletions numba/parfors/parfor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1350,15 +1350,14 @@ class PreParforPass(object):
implementations of numpy functions if available.
"""
def __init__(self, func_ir, typemap, calltypes, typingctx, options,
swapped={}, replace_functions_map=replace_functions_map):
swapped={}):
self.func_ir = func_ir
self.typemap = typemap
self.calltypes = calltypes
self.typingctx = typingctx
self.options = options
# diagnostics
self.swapped = swapped
self.replace_functions_map = replace_functions_map
self.stats = {
'replaced_func': 0,
'replaced_dtype': 0,
Expand Down Expand Up @@ -1395,7 +1394,7 @@ def _replace_parallel_functions(self, blocks):
def replace_func():
func_def = get_definition(self.func_ir, expr.func)
callname = find_callname(self.func_ir, expr)
repl_func = self.replace_functions_map.get(callname, None)
repl_func = replace_functions_map.get(callname, None)
# Handle method on array type
if (repl_func is None and
len(callname) == 2 and
Expand Down