Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix test_import error
  • Loading branch information
guilhermeleobas committed Nov 15, 2023
commit f49e05b0fd65e27b467ac01becb79e3aec8e7de4
8 changes: 6 additions & 2 deletions numba/np/ufunc/dufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from numba.parfors import array_analysis
from numba.np.ufunc import ufuncbuilder
from numba.np import numpy_support
from numba.np.arrayobj import (load_item, store_item, normalize_indices,
FancyIndexer, make_array)
from typing import Callable
from llvmlite import ir

Expand All @@ -43,6 +41,8 @@ def need_advanced_indexing(self):
return isinstance(self.indices_ty, types.BaseTuple)

def _prepare(self, context, builder):
from numba.np.arrayobj import normalize_indices, FancyIndexer

a, indices = self.a, self.indices
a_ty, indices_ty = self.a_ty, self.indices_ty

Expand All @@ -69,6 +69,7 @@ def _prepare(self, context, builder):
self.cres = self._compile_ufunc(context, builder)

def _load_val(self, context, builder, loop_indices, array, array_ty):
from numba.np.arrayobj import load_item
shapes = cgutils.unpack_tuple(builder, array.shape)
strides = cgutils.unpack_tuple(builder, array.strides)
data = array.data
Expand All @@ -92,6 +93,7 @@ def _load_flat(self, context, builder, indices, array, array_ty):
return None, val

def _store_val(self, context, builder, array, array_ty, ptr, val):
from numba.np.arrayobj import store_item
fromty = self.cres.signature.return_type
toty = array_ty.dtype
val = context.cast(builder, val, fromty, toty)
Expand Down Expand Up @@ -433,6 +435,8 @@ def ol_at(ufunc, a, indices, b=None):
self.add((a.dtype, b.dtype))

def apply_ufunc_codegen(context, builder, sig, args):
from numba.np.arrayobj import make_array

if len(args) == 4:
_, aty, idxty, bty = sig.args
_, a, indices, b = args
Expand Down