after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Context.unload_module(). Both must have
# cleared the module reference from the context.
assert shutting_down() ... | def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Context.unload_module(). Both must have
# cleared the module reference from the context.
assert shutting_down() ... | https://github.com/numba/numba/issues/4352 | Traceback (most recent call last):
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc
f()
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/conda/envs/gdf/lib/python3.6/site-packages/... | AttributeError |
def _module_finalizer(context, handle):
dealloc = context.deallocations
modules = context.modules
def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Co... | def _module_finalizer(context, handle):
dealloc = context.deallocations
modules = context.modules
def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Co... | https://github.com/numba/numba/issues/4352 | Traceback (most recent call last):
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc
f()
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/conda/envs/gdf/lib/python3.6/site-packages/... | AttributeError |
def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Context.unload_module(). Both must have
# cleared the module reference from the context.
assert shutting_down() ... | def core():
shutting_down = utils.shutting_down # early bind
def module_unload(handle):
# If we are not shutting down, we must be called due to
# Context.reset() of Context.unload_module(). Both must have
# cleared the module reference from the context.
assert shutting_down() ... | https://github.com/numba/numba/issues/4352 | Traceback (most recent call last):
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc
f()
File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/conda/envs/gdf/lib/python3.6/site-packages/... | AttributeError |
def raise_on_unsupported_feature(func_ir, typemap):
"""
Helper function to walk IR and raise if it finds op codes
that are unsupported. Could be extended to cover IR sequences
as well as op codes. Intended use is to call it as a pipeline
stage just prior to lowering to prevent LoweringErrors for kno... | def raise_on_unsupported_feature(func_ir, typemap):
"""
Helper function to walk IR and raise if it finds op codes
that are unsupported. Could be extended to cover IR sequences
as well as op codes. Intended use is to call it as a pipeline
stage just prior to lowering to prevent LoweringErrors for kno... | https://github.com/numba/numba/issues/4143 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
~/Miscelania/anaconda3/lib/python3.6/site-packages/numba/targets/base.py in get_constant_generic(self, builder, ty, val)
498 try:
--> 499 impl = sel... | NotImplementedError |
def _find_definition(self):
# try and find a def, go backwards from error line
fn_name = None
lines = self.get_lines()
for x in reversed(lines[: self.line - 1]):
# the strip and startswith is to handle user code with commented out
# 'def' or use of 'def' in a docstring.
if x.stri... | def _find_definition(self):
# try and find a def, go backwards from error line
fn_name = None
lines = self.get_lines()
for x in reversed(lines[: self.line - 1]):
if "def " in x:
fn_name = x
break
return fn_name
| https://github.com/numba/numba/issues/4056 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/.local/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
626 try:
--> 627 yield
628 except NumbaError as e:
~/.... | AttributeError |
def get_cache_path(self):
# We could also use jupyter_core.paths.jupyter_runtime_dir()
# In both cases this is a user-wide directory, so we need to
# be careful when disambiguating if we don't want too many
# conflicts (see below).
try:
from IPython.paths import get_ipython_cache_dir
exc... | def get_cache_path(self):
# We could also use jupyter_core.paths.jupyter_runtime_dir()
# In both cases this is a user-wide directory, so we need to
# be careful when disambiguating if we don't want too many
# conflicts (see below).
try:
from IPython.paths import get_ipython_cache_dir
exc... | https://github.com/numba/numba/issues/4040 | (gammapy-dev) hfm-1804a:tmp deil$ ipython
Python 3.7.0 | packaged by conda-forge | (default, Nov 12 2018, 12:34:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import numba
In [2]: numba.jit
---------------------------------... | AttributeError |
def _lower_array_expr(lowerer, expr):
"""Lower an array expression built by RewriteArrayExprs."""
expr_name = "__numba_array_expr_%s" % (hex(hash(expr)).replace("-", "_"))
expr_filename = expr.loc.filename
expr_var_list = expr.list_vars()
# The expression may use a given variable several times, but ... | def _lower_array_expr(lowerer, expr):
"""Lower an array expression built by RewriteArrayExprs."""
expr_name = "__numba_array_expr_%s" % (hex(hash(expr)).replace("-", "_"))
expr_filename = expr.loc.filename
expr_var_list = expr.list_vars()
# The expression may use a given variable several times, but ... | https://github.com/numba/numba/issues/3972 | @njit((float_[:], optional(float_[:])))
... def f(x, y):
... if y is None:
... return x
... return x + y
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/lizli/anaconda3/lib/python3.7/site-packages/numba/decorators.py", line 198, in wrapper
disp.compile(sig)
File "... | numba.errors.TypingError |
def _prepare_argument(ctxt, bld, inp, tyinp, where="input operand"):
"""returns an instance of the appropriate Helper (either
_ScalarHelper or _ArrayHelper) class to handle the argument.
using the polymorphic interface of the Helper classes, scalar
and array cases can be handled with the same code"""
... | def _prepare_argument(ctxt, bld, inp, tyinp, where="input operand"):
"""returns an instance of the appropriate Helper (either
_ScalarHelper or _ArrayHelper) class to handle the argument.
using the polymorphic interface of the Helper classes, scalar
and array cases can be handled with the same code"""
... | https://github.com/numba/numba/issues/3972 | @njit((float_[:], optional(float_[:])))
... def f(x, y):
... if y is None:
... return x
... return x + y
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/lizli/anaconda3/lib/python3.7/site-packages/numba/decorators.py", line 198, in wrapper
disp.compile(sig)
File "... | numba.errors.TypingError |
def get_sys_info():
# delay these imports until now as they are only needed in this
# function which then exits.
import platform
import json
import multiprocessing
from numba import config
from numba import cuda as cu
from numba.cuda import cudadrv
from numba.cuda.cudadrv.driver impo... | def get_sys_info():
# delay these imports until now as they are only needed in this
# function which then exits.
import platform
import json
import multiprocessing
from numba import config
from numba import cuda as cu
from numba.cuda import cudadrv
from numba.cuda.cudadrv.driver impo... | https://github.com/numba/numba/issues/3974 | (base) hfm-1804a:~ deil$ python
Python 3.7.3 (default, Mar 27 2019, 16:54:48)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
import locale
locale.getlocale()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
... | ValueError |
def stage_preserve_ir(self):
self.func_ir_original = copy.deepcopy(self.func_ir)
| def stage_preserve_ir(self):
self.func_ir_original = self.func_ir.copy()
| https://github.com/numba/numba/issues/3659 | Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylower... | AssertionError |
def stage_inline_pass(self):
"""
Inline calls to locally defined closures.
"""
# Ensure we have an IR and type information.
assert self.func_ir
# if the return type is a pyobject, there's no type info available and
# no ability to resolve certain typed function calls in the array
# inli... | def stage_inline_pass(self):
"""
Inline calls to locally defined closures.
"""
# Ensure we have an IR and type information.
assert self.func_ir
inline_pass = InlineClosureCallPass(
self.func_ir, self.flags.auto_parallel, self.parfor_diagnostics.replaced_fns
)
inline_pass.run()
... | https://github.com/numba/numba/issues/3659 | Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylower... | AssertionError |
def __init__(self, func_ir, parallel_options, swapped={}, typed=False):
self.func_ir = func_ir
self.parallel_options = parallel_options
self.swapped = swapped
self._processed_stencils = []
self.typed = typed
| def __init__(self, func_ir, parallel_options, swapped={}):
self.func_ir = func_ir
self.parallel_options = parallel_options
self.swapped = swapped
self._processed_stencils = []
| https://github.com/numba/numba/issues/3659 | Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylower... | AssertionError |
def run(self):
"""Run inline closure call pass."""
modified = False
work_list = list(self.func_ir.blocks.items())
debug_print = _make_debug_print("InlineClosureCallPass")
debug_print("START")
while work_list:
label, block = work_list.pop()
for i, instr in enumerate(block.body):
... | def run(self):
"""Run inline closure call pass."""
modified = False
work_list = list(self.func_ir.blocks.items())
debug_print = _make_debug_print("InlineClosureCallPass")
debug_print("START")
while work_list:
label, block = work_list.pop()
for i, instr in enumerate(block.body):
... | https://github.com/numba/numba/issues/3659 | Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylower... | AssertionError |
def _inline_arraycall(
func_ir, cfg, visited, loop, swapped, enable_prange=False, typed=False
):
"""Look for array(list) call in the exit block of a given loop, and turn list operations into
array operations in the loop if the following conditions are met:
1. The exit block contains an array call on t... | def _inline_arraycall(func_ir, cfg, visited, loop, swapped, enable_prange=False):
"""Look for array(list) call in the exit block of a given loop, and turn list operations into
array operations in the loop if the following conditions are met:
1. The exit block contains an array call on the list;
2. T... | https://github.com/numba/numba/issues/3659 | Traceback (most recent call last):
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\errors.py", line 617, in new_error_context
yield
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "C:\Users\yukoba\Anaconda3\lib\site-packages\numba\pylower... | AssertionError |
def has_no_side_effect(rhs, lives, call_table):
"""Returns True if this expression has no side effects that
would prevent re-ordering.
"""
if isinstance(rhs, ir.Expr) and rhs.op == "call":
func_name = rhs.func.name
if func_name not in call_table or call_table[func_name] == []:
... | def has_no_side_effect(rhs, lives, call_table):
"""Returns True if this expression has no side effects that
would prevent re-ordering.
"""
if isinstance(rhs, ir.Expr) and rhs.op == "call":
func_name = rhs.func.name
if func_name not in call_table or call_table[func_name] == []:
... | https://github.com/numba/numba/issues/3066 | Traceback (most recent call last):
File "./prange.py", line 10, in <module>
func(np.ones(10))
File "/home/bmerry/work/sdp/env3/lib/python3.5/site-packages/numba/dispatcher.py", line 344, in _compile_for_args
reraise(type(e), e, None)
File "/home/bmerry/work/sdp/env3/lib/python3.5/site-packages/numba/six.py", line 658, ... | numba.errors.TypingError |
def _replace_parallel_functions(self, blocks):
"""
Replace functions with their parallel implemntation in
replace_functions_map if available.
The implementation code is inlined to enable more optimization.
"""
from numba.inline_closurecall import inline_closure_call
work_list = list(blocks.... | def _replace_parallel_functions(self, blocks):
"""
Replace functions with their parallel implemntation in
replace_functions_map if available.
The implementation code is inlined to enable more optimization.
"""
from numba.inline_closurecall import inline_closure_call
work_list = list(blocks.... | https://github.com/numba/numba/issues/3066 | Traceback (most recent call last):
File "./prange.py", line 10, in <module>
func(np.ones(10))
File "/home/bmerry/work/sdp/env3/lib/python3.5/site-packages/numba/dispatcher.py", line 344, in _compile_for_args
reraise(type(e), e, None)
File "/home/bmerry/work/sdp/env3/lib/python3.5/site-packages/numba/six.py", line 658, ... | numba.errors.TypingError |
def find_file(pat, libdir=None):
if libdir is None:
libdirs = get_lib_dirs()
elif isinstance(libdir, str):
libdirs = [
libdir,
]
else:
libdirs = list(libdir)
files = []
for ldir in libdirs:
entries = os.listdir(ldir)
candidates = [os.path.j... | def find_file(pat, libdir=None):
if libdir is None:
libdirs = get_lib_dirs()
else:
libdirs = list(libdir)
files = []
for ldir in libdirs:
entries = os.listdir(ldir)
candidates = [os.path.join(ldir, ent) for ent in entries if pat.match(ent)]
files.extend([c for c i... | https://github.com/numba/numba/issues/3831 | Traceback (most recent call last):
File "cuda_issue.py", line 4, in <module>
@cuda.jit('(int64, float32)')
File "numba/numba/cuda/decorators.py", line 98, in kernel_jit
kernel.bind()
File "numba/numba/cuda/compiler.py", line 503, in bind
self._func.get()
File "numba/numba/cuda/compiler.py", line 381, in get
ptx = self.... | FileNotFoundError |
def get_generator_type(self, typdict, retty):
gi = self.generator_info
arg_types = [None] * len(self.arg_names)
for index, name in self.arg_names.items():
arg_types[index] = typdict[name]
state_types = [typdict[var_name] for var_name in gi.state_vars]
yield_types = [typdict[y.inst.value.name... | def get_generator_type(self, typdict, retty):
gi = self.generator_info
arg_types = [None] * len(self.arg_names)
for index, name in self.arg_names.items():
arg_types[index] = typdict[name]
state_types = [typdict[var_name] for var_name in gi.state_vars]
yield_types = [typdict[y.inst.value.name... | https://github.com/numba/numba/issues/3779 | Traceback (most recent call last):
File "/Users/ndv/Library/Python/3.6/lib/python/site-packages/numba/errors.py", line 617, in new_error_context
yield
File "/Users/ndv/Library/Python/3.6/lib/python/site-packages/numba/lowering.py", line 259, in lower_block
self.lower_inst(inst)
File "/Users/ndv/Library/Python/3.6/lib/p... | AssertionError |
def device_memory_size(devmem):
"""Check the memory size of the device memory.
The result is cached in the device memory object.
It may query the driver for the memory size of the device memory allocation.
"""
sz = getattr(devmem, "_cuda_memsize_", None)
if sz is None:
s, e = device_exte... | def device_memory_size(devmem):
"""Check the memory size of the device memory.
The result is cached in the device memory object.
It may query the driver for the memory size of the device memory allocation.
"""
sz = getattr(devmem, "_cuda_memsize_", None)
if sz is None:
s, e = device_exte... | https://github.com/numba/numba/issues/3705 | Traceback (most recent call last):
File "pyarrow/tests/numba_bug.py", line 9, in <module>
d_arr[::-1].copy_to_host()
File "/home/pearu/miniconda3/envs/pyarrow-dev/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/home/pearu/miniconda3/envs/pyar... | ValueError |
def __init__(self, start, stop, size, stride, single):
self.start = start
self.stop = stop
self.size = size
self.stride = stride
self.single = single
assert not single or size == 1
| def __init__(self, start, stop, size, stride, single):
if stop < start:
raise ValueError("end offset is before start offset")
self.start = start
self.stop = stop
self.size = size
self.stride = stride
self.single = single
assert not single or size == 1
| https://github.com/numba/numba/issues/3705 | Traceback (most recent call last):
File "pyarrow/tests/numba_bug.py", line 9, in <module>
d_arr[::-1].copy_to_host()
File "/home/pearu/miniconda3/envs/pyarrow-dev/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/home/pearu/miniconda3/envs/pyar... | ValueError |
def __getitem__(self, item):
if isinstance(item, slice):
start, stop, step = item.indices(self.size)
stride = step * self.stride
start = self.start + start * abs(self.stride)
stop = self.start + stop * abs(self.stride)
if stride == 0:
size = 1
else:
... | def __getitem__(self, item):
if isinstance(item, slice):
start, stop, step = item.start, item.stop, item.step
single = False
else:
single = True
start = item
stop = start + 1
step = None
# Default values
# Start value is default to zero
if start is ... | https://github.com/numba/numba/issues/3705 | Traceback (most recent call last):
File "pyarrow/tests/numba_bug.py", line 9, in <module>
d_arr[::-1].copy_to_host()
File "/home/pearu/miniconda3/envs/pyarrow-dev/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/home/pearu/miniconda3/envs/pyar... | ValueError |
def copy_to_host(self, ary=None, stream=0):
"""Copy ``self`` to ``ary`` or create a new Numpy ndarray
if ``ary`` is ``None``.
If a CUDA ``stream`` is given, then the transfer will be made
asynchronously as part as the given stream. Otherwise, the transfer is
synchronous: the function returns after... | def copy_to_host(self, ary=None, stream=0):
"""Copy ``self`` to ``ary`` or create a new Numpy ndarray
if ``ary`` is ``None``.
If a CUDA ``stream`` is given, then the transfer will be made
asynchronously as part as the given stream. Otherwise, the transfer is
synchronous: the function returns after... | https://github.com/numba/numba/issues/3705 | Traceback (most recent call last):
File "pyarrow/tests/numba_bug.py", line 9, in <module>
d_arr[::-1].copy_to_host()
File "/home/pearu/miniconda3/envs/pyarrow-dev/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/home/pearu/miniconda3/envs/pyar... | ValueError |
def infer_constant(self, name, loc=None):
"""
Infer a constant value for the given variable *name*.
If no value can be inferred, numba.errors.ConstantInferenceError
is raised.
"""
if name not in self._cache:
try:
self._cache[name] = (True, self._do_infer(name))
except... | def infer_constant(self, name):
"""
Infer a constant value for the given variable *name*.
If no value can be inferred, numba.errors.ConstantInferenceError
is raised.
"""
if name not in self._cache:
try:
self._cache[name] = (True, self._do_infer(name))
except ConstantI... | https://github.com/numba/numba/issues/3717 | ---------------------------------------------------------------------------
ConstantInferenceError Traceback (most recent call last)
<ipython-input-29-41c708083646> in <module>
5 return a*b
6
----> 7 problem(1,2)
~/.virtualenvs/dl4cv/lib/python3.7/site-packages/numba/dispatcher.py in _compile_fo... | ConstantInferenceError |
def _fail(self, val):
# The location here is set to None because `val` is the ir.Var name
# and not the actual offending use of the var. When this is raised it is
# caught in the flow control of `infer_constant` and the class and args
# (the message) are captured and then raised again but with the locat... | def _fail(self, val):
raise ConstantInferenceError("constant inference not possible for %s" % (val,))
| https://github.com/numba/numba/issues/3717 | ---------------------------------------------------------------------------
ConstantInferenceError Traceback (most recent call last)
<ipython-input-29-41c708083646> in <module>
5 return a*b
6
----> 7 problem(1,2)
~/.virtualenvs/dl4cv/lib/python3.7/site-packages/numba/dispatcher.py in _compile_fo... | ConstantInferenceError |
def _infer_expr(self, expr):
# Infer an expression: handle supported cases
if expr.op == "call":
func = self.infer_constant(expr.func.name, loc=expr.loc)
return self._infer_call(func, expr)
elif expr.op == "getattr":
value = self.infer_constant(expr.value.name, loc=expr.loc)
... | def _infer_expr(self, expr):
# Infer an expression: handle supported cases
if expr.op == "call":
func = self.infer_constant(expr.func.name)
return self._infer_call(func, expr)
elif expr.op == "getattr":
value = self.infer_constant(expr.value.name)
return self._infer_getattr(v... | https://github.com/numba/numba/issues/3717 | ---------------------------------------------------------------------------
ConstantInferenceError Traceback (most recent call last)
<ipython-input-29-41c708083646> in <module>
5 return a*b
6
----> 7 problem(1,2)
~/.virtualenvs/dl4cv/lib/python3.7/site-packages/numba/dispatcher.py in _compile_fo... | ConstantInferenceError |
def _infer_call(self, func, expr):
if expr.kws or expr.vararg:
self._fail(expr)
# Check supported callables
_slice = func in (slice,)
_exc = isinstance(func, type) and issubclass(func, BaseException)
if _slice or _exc:
args = [self.infer_constant(a.name, loc=expr.loc) for a in expr.a... | def _infer_call(self, func, expr):
if expr.kws or expr.vararg:
self._fail(expr)
# Check supported callables
_slice = func in (slice,)
_exc = isinstance(func, type) and issubclass(func, BaseException)
if _slice or _exc:
args = [self.infer_constant(a.name) for a in expr.args]
i... | https://github.com/numba/numba/issues/3717 | ---------------------------------------------------------------------------
ConstantInferenceError Traceback (most recent call last)
<ipython-input-29-41c708083646> in <module>
5 return a*b
6
----> 7 problem(1,2)
~/.virtualenvs/dl4cv/lib/python3.7/site-packages/numba/dispatcher.py in _compile_fo... | ConstantInferenceError |
def __init__(self, value, loc=None):
super(ConstantInferenceError, self).__init__(value, loc=loc)
| def __init__(self, value, loc=None):
self.value = value
msg = "Cannot make a constant from: %s" % value
super(ConstantInferenceError, self).__init__(msg, loc=loc)
| https://github.com/numba/numba/issues/3717 | ---------------------------------------------------------------------------
ConstantInferenceError Traceback (most recent call last)
<ipython-input-29-41c708083646> in <module>
5 return a*b
6
----> 7 problem(1,2)
~/.virtualenvs/dl4cv/lib/python3.7/site-packages/numba/dispatcher.py in _compile_fo... | ConstantInferenceError |
def as_method(self):
"""
Convert this signature to a bound method signature.
"""
if self.recvr is not None:
return self
sig = signature(self.return_type, *self.args[1:], recvr=self.args[0])
# Adjust the python signature
params = list(self.pysig.parameters.values())[1:]
sig.pysig... | def as_method(self):
"""
Convert this signature to a bound method signature.
"""
if self.recvr is not None:
return self
sig = signature(self.return_type, *self.args[1:], recvr=self.args[0])
return sig
| https://github.com/numba/numba/issues/3489 | Traceback (most recent call last):
File "<path>/numba/numba/errors.py", line 601, in new_error_context
yield
File "<path>/numba/numba/lowering.py", line 257, in lower_block
self.lower_inst(inst)
File "<path>/numba/numba/lowering.py", line 306, in lower_inst
val = self.lower_assign(ty, inst)
File "<path>/numba/numba/low... | TypeError |
def _get_dispatcher(cls, context, typ, attr, sig_args, sig_kws):
"""
Get the compiled dispatcher implementing the attribute for
the given formal signature.
"""
cache_key = context, typ, attr, tuple(sig_args), tuple(sig_kws.items())
try:
disp = cls._impl_cache[cache_key]
except KeyErr... | def _get_dispatcher(cls, context, typ, attr, sig_args, sig_kws):
"""
Get the compiled dispatcher implementing the attribute for
the given formal signature.
"""
cache_key = context, typ, attr
try:
disp = cls._impl_cache[cache_key]
except KeyError:
# Get the overload implementa... | https://github.com/numba/numba/issues/3489 | Traceback (most recent call last):
File "<path>/numba/numba/errors.py", line 601, in new_error_context
yield
File "<path>/numba/numba/lowering.py", line 257, in lower_block
self.lower_inst(inst)
File "<path>/numba/numba/lowering.py", line 306, in lower_inst
val = self.lower_assign(ty, inst)
File "<path>/numba/numba/low... | TypeError |
def do_class_init(cls):
"""
Register generic method implementation.
"""
from numba.targets.imputils import lower_builtin
attr = cls._attr
@lower_builtin((cls.key, attr), cls.key, types.VarArg(types.Any))
def method_impl(context, builder, sig, args):
typ = sig.args[0]
typing... | def do_class_init(cls):
"""
Register generic method implementation.
"""
from numba.targets.imputils import lower_builtin
attr = cls._attr
@lower_builtin((cls.key, attr), cls.key, types.VarArg(types.Any))
def method_impl(context, builder, sig, args):
typ = sig.args[0]
typing... | https://github.com/numba/numba/issues/3489 | Traceback (most recent call last):
File "<path>/numba/numba/errors.py", line 601, in new_error_context
yield
File "<path>/numba/numba/lowering.py", line 257, in lower_block
self.lower_inst(inst)
File "<path>/numba/numba/lowering.py", line 306, in lower_inst
val = self.lower_assign(ty, inst)
File "<path>/numba/numba/low... | TypeError |
def method_impl(context, builder, sig, args):
typ = sig.args[0]
typing_context = context.typing_context
disp = cls._get_dispatcher(typing_context, typ, attr, sig.args, {})
disp_type = types.Dispatcher(disp)
sig = disp_type.get_call_type(typing_context, sig.args, {})
call = context.get_function(d... | def method_impl(context, builder, sig, args):
typ = sig.args[0]
typing_context = context.typing_context
disp = cls._get_dispatcher(typing_context, typ, attr, sig.args, {})
disp_type = types.Dispatcher(disp)
sig = disp_type.get_call_type(typing_context, sig.args, {})
call = context.get_function(d... | https://github.com/numba/numba/issues/3489 | Traceback (most recent call last):
File "<path>/numba/numba/errors.py", line 601, in new_error_context
yield
File "<path>/numba/numba/lowering.py", line 257, in lower_block
self.lower_inst(inst)
File "<path>/numba/numba/lowering.py", line 306, in lower_inst
val = self.lower_assign(ty, inst)
File "<path>/numba/numba/low... | TypeError |
def from_types(cls, tys, pyclass=None):
"""
Instantiate the right tuple type for the given element types.
"""
if pyclass is not None and pyclass is not tuple:
# A subclass => is it a namedtuple?
assert issubclass(pyclass, tuple)
if hasattr(pyclass, "_asdict"):
tys = t... | def from_types(cls, tys, pyclass=None):
"""
Instantiate the right tuple type for the given element types.
"""
homogeneous = False
if tys:
first = tys[0]
for ty in tys[1:]:
if ty != first:
break
else:
homogeneous = True
if pyclass i... | https://github.com/numba/numba/issues/3565 | ---------------------------------------------------------------------------
TypingError Traceback (most recent call last)
<ipython-input-60-b047fa49e45c> in <module>()
----> 1 call(1, 1)
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numba/dispatch... | TypingError |
def unify(self):
"""
Run the final unification pass over all inferred types, and
catch imprecise types.
"""
typdict = utils.UniqueDict()
def find_offender(name, exhaustive=False):
# finds the offending variable definition by name
# if exhaustive is set it will try and trace thro... | def unify(self):
"""
Run the final unification pass over all inferred types, and
catch imprecise types.
"""
typdict = utils.UniqueDict()
def find_offender(name, exhaustive=False):
# finds the offending variable definition by name
# if exhaustive is set it will try and trace thro... | https://github.com/numba/numba/issues/3389 | Traceback (most recent call last):
File "examples/hello.py", line 25, in <module>
main()
File "examples/hello.py", line 19, in main
print(hpat(2))
File "numba/numba/dispatcher.py", line 367, in _compile_for_args
raise e
File "numba/numba/dispatcher.py", line 324, in _compile_for_args
return self.compile(tuple(argtypes)... | AttributeError |
def check_var(name):
tv = self.typevars[name]
if not tv.defined:
offender = find_offender(name)
val = getattr(offender, "value", "unknown operation")
loc = getattr(offender, "loc", ir.unknown_loc)
msg = "Undefined variable '%s', operation: %s, location: %s"
raise TypingEr... | def check_var(name):
tv = self.typevars[name]
if not tv.defined:
offender = find_offender(name)
val = getattr(offender, "value", "unknown operation")
loc = getattr(offender, "loc", "unknown location")
msg = "Undefined variable '%s', operation: %s, location: %s"
raise Typi... | https://github.com/numba/numba/issues/3389 | Traceback (most recent call last):
File "examples/hello.py", line 25, in <module>
main()
File "examples/hello.py", line 19, in main
print(hpat(2))
File "numba/numba/dispatcher.py", line 367, in _compile_for_args
raise e
File "numba/numba/dispatcher.py", line 324, in _compile_for_args
return self.compile(tuple(argtypes)... | AttributeError |
def _unify_return_types(self, rettypes):
if rettypes:
unified = self.context.unify_types(*rettypes)
if unified is None or not unified.is_precise():
def check_type(atype):
lst = []
for k, v in self.typevars.items():
if atype == v.type:
... | def _unify_return_types(self, rettypes):
if rettypes:
unified = self.context.unify_types(*rettypes)
if unified is None or not unified.is_precise():
def check_type(atype):
lst = []
for k, v in self.typevars.items():
if atype == v.type:
... | https://github.com/numba/numba/issues/3389 | Traceback (most recent call last):
File "examples/hello.py", line 25, in <module>
main()
File "examples/hello.py", line 19, in main
print(hpat(2))
File "numba/numba/dispatcher.py", line 367, in _compile_for_args
raise e
File "numba/numba/dispatcher.py", line 324, in _compile_for_args
return self.compile(tuple(argtypes)... | AttributeError |
def check_type(atype):
lst = []
for k, v in self.typevars.items():
if atype == v.type:
lst.append(k)
returns = {}
for x in reversed(lst):
for block in self.func_ir.blocks.values():
for instr in block.find_insts(ir.Return):
value = instr.value
... | def check_type(atype):
lst = []
for k, v in self.typevars.items():
if atype == v.type:
lst.append(k)
returns = {}
for x in reversed(lst):
for block in self.func_ir.blocks.values():
for instr in block.find_insts(ir.Return):
value = instr.value
... | https://github.com/numba/numba/issues/3389 | Traceback (most recent call last):
File "examples/hello.py", line 25, in <module>
main()
File "examples/hello.py", line 19, in main
print(hpat(2))
File "numba/numba/dispatcher.py", line 367, in _compile_for_args
raise e
File "numba/numba/dispatcher.py", line 324, in _compile_for_args
return self.compile(tuple(argtypes)... | AttributeError |
def _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args):
# Overall approach:
# 1) Construct a string containing a function definition for the stencil function
# that will execute the stencil kernel. This function definition includes a
# unique stencil function name, the... | def _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args):
# Overall approach:
# 1) Construct a string containing a function definition for the stencil function
# that will execute the stencil kernel. This function definition includes a
# unique stencil function name, the... | https://github.com/numba/numba/issues/3497 | $ python ml1.py
[[False False False False False]
[False False True False False]
[False True False True False]
[False False False False False]]
Traceback (most recent call last):
File "ml1.py", line 16, in <module>
print(njit(foo)(A))
File "<path>/numba/numba/dispatcher.py", line 348, in _compile_for_args
error_rewri... | numba.errors.TypingError |
def __init__(
self,
native,
modname,
qualname,
unique_name,
doc,
typemap,
restype,
calltypes,
args,
kws,
mangler=None,
argtypes=None,
inline=False,
noalias=False,
env_name=None,
global_dict=None,
):
self.native = native
self.modname = modname
... | def __init__(
self,
native,
modname,
qualname,
unique_name,
doc,
typemap,
restype,
calltypes,
args,
kws,
mangler=None,
argtypes=None,
inline=False,
noalias=False,
env_name=None,
):
self.native = native
self.modname = modname
self.qualname = qua... | https://github.com/numba/numba/issues/3355 | Traceback (most recent call last):
File "tmp_tests/obj_gen_test.py", line 14, in <module>
g()
NameError: global name 'np' is not defined | NameError |
def _get_function_info(cls, func_ir):
"""
Returns
-------
qualname, unique_name, modname, doc, args, kws, globals
``unique_name`` must be a unique name.
"""
func = func_ir.func_id.func
qualname = func_ir.func_id.func_qualname
# XXX to func_id
modname = func.__module__
doc = ... | def _get_function_info(cls, func_ir):
"""
Returns
-------
qualname, unique_name, modname, doc, args, kws, globals
``unique_name`` must be a unique name.
"""
func = func_ir.func_id.func
qualname = func_ir.func_id.func_qualname
# XXX to func_id
modname = func.__module__
doc = ... | https://github.com/numba/numba/issues/3355 | Traceback (most recent call last):
File "tmp_tests/obj_gen_test.py", line 14, in <module>
g()
NameError: global name 'np' is not defined | NameError |
def _from_python_function(
cls,
func_ir,
typemap,
restype,
calltypes,
native,
mangler=None,
inline=False,
noalias=False,
):
(
qualname,
unique_name,
modname,
doc,
args,
kws,
global_dict,
) = cls._get_function_info(func_i... | def _from_python_function(
cls,
func_ir,
typemap,
restype,
calltypes,
native,
mangler=None,
inline=False,
noalias=False,
):
(
qualname,
unique_name,
modname,
doc,
args,
kws,
) = cls._get_function_info(func_ir)
self = cls(
... | https://github.com/numba/numba/issues/3355 | Traceback (most recent call last):
File "tmp_tests/obj_gen_test.py", line 14, in <module>
g()
NameError: global name 'np' is not defined | NameError |
def from_fndesc(cls, fndesc):
try:
# Avoid creating new Env
return cls._memo[fndesc.env_name]
except KeyError:
inst = cls(fndesc.lookup_globals())
inst.env_name = fndesc.env_name
cls._memo[fndesc.env_name] = inst
return inst
| def from_fndesc(cls, fndesc):
mod = fndesc.lookup_module()
try:
# Avoid creating new Env
return cls._memo[fndesc.env_name]
except KeyError:
inst = cls(mod.__dict__)
inst.env_name = fndesc.env_name
cls._memo[fndesc.env_name] = inst
return inst
| https://github.com/numba/numba/issues/3355 | Traceback (most recent call last):
File "tmp_tests/obj_gen_test.py", line 14, in <module>
g()
NameError: global name 'np' is not defined | NameError |
def from_cuda_array_interface(desc, owner=None):
"""Create a DeviceNDArray from a cuda-array-interface description.
The *owner* is the owner of the underlying memory.
The resulting DeviceNDArray will acquire a reference from it.
"""
shape = desc["shape"]
strides = desc.get("strides")
dtype =... | def from_cuda_array_interface(desc, owner=None):
"""Create a DeviceNDArray from a cuda-array-interface description.
The *owner* is the owner of the underlying memory.
The resulting DeviceNDArray will acquire a reference from it.
"""
shape = desc["shape"]
strides = desc.get("strides")
dtype =... | https://github.com/numba/numba/issues/3333 | $ python repro_indexing.py
Traceback (most recent call last):
File "repro_indexing.py", line 8, in <module>
ext_arrslice = ext_arr[:5]
File "/scratch/USERS/fordas/workspace/numba_min/.conda/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/scra... | AttributeError |
def view(self, start, stop=None):
if stop is None:
size = self.size - start
else:
size = stop - start
# Handle NULL/empty memory buffer
if self.device_pointer.value is None:
if size != 0:
raise RuntimeError("non-empty slice into empty slice")
view = self # n... | def view(self, start, stop=None):
if stop is None:
size = self.size - start
else:
size = stop - start
# Handle NULL/empty memory buffer
if self.device_pointer.value is None:
if size != 0:
raise RuntimeError("non-empty slice into empty slice")
view = self # n... | https://github.com/numba/numba/issues/3333 | $ python repro_indexing.py
Traceback (most recent call last):
File "repro_indexing.py", line 8, in <module>
ext_arrslice = ext_arr[:5]
File "/scratch/USERS/fordas/workspace/numba_min/.conda/lib/python3.7/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context
return fn(*args, **kws)
File "/scra... | AttributeError |
def min_parallel_impl(return_type, arg):
# XXX: use prange for 1D arrays since pndindex returns a 1-tuple instead of
# integer. This causes type and fusion issues.
if arg.ndim == 1:
def min_1(in_arr):
numba.parfor.init_prange()
min_checker(len(in_arr))
val = numb... | def min_parallel_impl(return_type, arg):
# XXX: use prange for 1D arrays since pndindex returns a 1-tuple instead of
# integer. This causes type and fusion issues.
if arg.ndim == 1:
def min_1(in_arr):
numba.parfor.init_prange()
val = numba.targets.builtins.get_type_max_value... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def min_1(in_arr):
numba.parfor.init_prange()
min_checker(len(in_arr))
val = numba.targets.builtins.get_type_max_value(in_arr.dtype)
for i in numba.pndindex(in_arr.shape):
val = min(val, in_arr[i])
return val
| def min_1(in_arr):
numba.parfor.init_prange()
val = numba.targets.builtins.get_type_max_value(in_arr.dtype)
for i in numba.pndindex(in_arr.shape):
val = min(val, in_arr[i])
return val
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def max_parallel_impl(return_type, arg):
if arg.ndim == 1:
def max_1(in_arr):
numba.parfor.init_prange()
max_checker(len(in_arr))
val = numba.targets.builtins.get_type_min_value(in_arr.dtype)
for i in numba.parfor.internal_prange(len(in_arr)):
... | def max_parallel_impl(return_type, arg):
if arg.ndim == 1:
def max_1(in_arr):
numba.parfor.init_prange()
val = numba.targets.builtins.get_type_min_value(in_arr.dtype)
for i in numba.parfor.internal_prange(len(in_arr)):
val = max(val, in_arr[i])
... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def max_1(in_arr):
numba.parfor.init_prange()
max_checker(len(in_arr))
val = numba.targets.builtins.get_type_min_value(in_arr.dtype)
for i in numba.pndindex(in_arr.shape):
val = max(val, in_arr[i])
return val
| def max_1(in_arr):
numba.parfor.init_prange()
val = numba.targets.builtins.get_type_min_value(in_arr.dtype)
for i in numba.pndindex(in_arr.shape):
val = max(val, in_arr[i])
return val
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def argmin_parallel_impl(in_arr):
numba.parfor.init_prange()
argmin_checker(len(in_arr))
A = in_arr.ravel()
init_val = numba.targets.builtins.get_type_max_value(A.dtype)
ival = numba.typing.builtins.IndexValue(0, init_val)
for i in numba.parfor.internal_prange(len(A)):
curr_ival = numba.... | def argmin_parallel_impl(in_arr):
numba.parfor.init_prange()
A = in_arr.ravel()
init_val = numba.targets.builtins.get_type_max_value(A.dtype)
ival = numba.typing.builtins.IndexValue(0, init_val)
for i in numba.parfor.internal_prange(len(A)):
curr_ival = numba.typing.builtins.IndexValue(i, A[... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def argmax_parallel_impl(in_arr):
numba.parfor.init_prange()
argmax_checker(len(in_arr))
A = in_arr.ravel()
init_val = numba.targets.builtins.get_type_min_value(A.dtype)
ival = numba.typing.builtins.IndexValue(0, init_val)
for i in numba.parfor.internal_prange(len(A)):
curr_ival = numba.... | def argmax_parallel_impl(in_arr):
numba.parfor.init_prange()
A = in_arr.ravel()
init_val = numba.targets.builtins.get_type_min_value(A.dtype)
ival = numba.typing.builtins.IndexValue(0, init_val)
for i in numba.parfor.internal_prange(len(A)):
curr_ival = numba.typing.builtins.IndexValue(i, A[... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def _replace_parallel_functions(self, blocks):
"""
Replace functions with their parallel implemntation in
replace_functions_map if available.
The implementation code is inlined to enable more optimization.
"""
from numba.inline_closurecall import inline_closure_call
work_list = list(blocks.... | def _replace_parallel_functions(self, blocks):
"""
Replace functions with their parallel implemntation in
replace_functions_map if available.
The implementation code is inlined to enable more optimization.
"""
from numba.inline_closurecall import inline_closure_call
work_list = list(blocks.... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def replace_func():
func_def = get_definition(self.func_ir, expr.func)
callname = find_callname(self.func_ir, expr)
repl_func = replace_functions_map.get(callname, None)
require(repl_func != None)
typs = tuple(self.typemap[x.name] for x in expr.args)
try:
new_func = repl_func(lhs_typ, *t... | def replace_func():
func_def = get_definition(self.func_ir, expr.func)
callname = find_callname(self.func_ir, expr)
repl_func = replace_functions_map.get(callname, None)
require(repl_func != None)
typs = tuple(self.typemap[x.name] for x in expr.args)
try:
new_func = repl_func(lhs_typ, *t... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_min(context, builder, sig, args):
ty = sig.args[0].dtype
if isinstance(ty, (types.NPDatetime, types.NPTimedelta)):
# NaT is smaller than every other value, but it is
# ignored as far as min() is concerned.
nat = ty("NaT")
def array_min_impl(arry):
if arry.s... | def array_min(context, builder, sig, args):
ty = sig.args[0].dtype
if isinstance(ty, (types.NPDatetime, types.NPTimedelta)):
# NaT is smaller than every other value, but it is
# ignored as far as min() is concerned.
nat = ty("NaT")
def array_min_impl(arry):
min_value... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_min_impl(arry):
if arry.size == 0:
raise ValueError(
("zero-size array to reduction operation minimum which has no identity")
)
it = np.nditer(arry)
for view in it:
min_value = view.item()
break
for view in it:
v = view.item()
if v <... | def array_min_impl(arry):
it = np.nditer(arry)
for view in it:
min_value = view.item()
break
for view in it:
v = view.item()
if v < min_value:
min_value = v
return min_value
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_max(context, builder, sig, args):
def array_max_impl(arry):
if arry.size == 0:
raise ValueError(
("zero-size array to reduction operation maximum which has no identity")
)
it = np.nditer(arry)
for view in it:
max_value = view.item... | def array_max(context, builder, sig, args):
def array_max_impl(arry):
it = np.nditer(arry)
for view in it:
max_value = view.item()
break
for view in it:
v = view.item()
if v > max_value:
max_value = v
return max_value
... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_max_impl(arry):
if arry.size == 0:
raise ValueError(
("zero-size array to reduction operation maximum which has no identity")
)
it = np.nditer(arry)
for view in it:
max_value = view.item()
break
for view in it:
v = view.item()
if v >... | def array_max_impl(arry):
it = np.nditer(arry)
for view in it:
max_value = view.item()
break
for view in it:
v = view.item()
if v > max_value:
max_value = v
return max_value
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_argmin(context, builder, sig, args):
ty = sig.args[0].dtype
# NOTE: Under Numpy < 1.10, argmin() is inconsistent with min() on NaT values:
# https://github.com/numpy/numpy/issues/6030
if numpy_version >= (1, 10) and isinstance(
ty, (types.NPDatetime, types.NPTimedelta)
):
... | def array_argmin(context, builder, sig, args):
ty = sig.args[0].dtype
# NOTE: Under Numpy < 1.10, argmin() is inconsistent with min() on NaT values:
# https://github.com/numpy/numpy/issues/6030
if numpy_version >= (1, 10) and isinstance(
ty, (types.NPDatetime, types.NPTimedelta)
):
... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_argmin_impl(arry):
if arry.size == 0:
raise ValueError("attempt to get argmin of an empty sequence")
for v in arry.flat:
min_value = v
min_idx = 0
break
idx = 0
for v in arry.flat:
if v < min_value:
min_value = v
min_idx = idx
... | def array_argmin_impl(arry):
for v in arry.flat:
min_value = v
min_idx = 0
break
idx = 0
for v in arry.flat:
if v < min_value:
min_value = v
min_idx = idx
idx += 1
return min_idx
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_argmax(context, builder, sig, args):
def array_argmax_impl(arry):
if arry.size == 0:
raise ValueError("attempt to get argmax of an empty sequence")
for v in arry.flat:
max_value = v
max_idx = 0
break
idx = 0
for v in arry.fla... | def array_argmax(context, builder, sig, args):
def array_argmax_impl(arry):
for v in arry.flat:
max_value = v
max_idx = 0
break
idx = 0
for v in arry.flat:
if v > max_value:
max_value = v
max_idx = idx
... | https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def array_argmax_impl(arry):
if arry.size == 0:
raise ValueError("attempt to get argmax of an empty sequence")
for v in arry.flat:
max_value = v
max_idx = 0
break
idx = 0
for v in arry.flat:
if v > max_value:
max_value = v
max_idx = idx
... | def array_argmax_impl(arry):
for v in arry.flat:
max_value = v
max_idx = 0
break
idx = 0
for v in arry.flat:
if v > max_value:
max_value = v
max_idx = idx
idx += 1
return max_idx
| https://github.com/numba/numba/issues/3119 | In [324]: def test_0d_min(X):
...: return np.min(X)
...:
...:
In [325]: test_0d_min(np.array([])) # correct behavior
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
... (omitted)
ValueError: zero-size array to ... | ValueError |
def call_parallel_gufunc(
lowerer,
cres,
gu_signature,
outer_sig,
expr_args,
expr_arg_types,
loop_ranges,
redvars,
reddict,
redarrdict,
init_block,
index_var_typ,
races,
):
"""
Adds the call to the gufunc function from the main function.
"""
context = ... | def call_parallel_gufunc(
lowerer,
cres,
gu_signature,
outer_sig,
expr_args,
expr_arg_types,
loop_ranges,
redvars,
reddict,
redarrdict,
init_block,
index_var_typ,
races,
):
"""
Adds the call to the gufunc function from the main function.
"""
context = ... | https://github.com/numba/numba/issues/3279 | ERROR: test_fuse_argmin (numba.tests.test_parfors.TestParfors)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/numba/numba/numba/errors.py", line 601, in new_error_context
yield
File "/home/travis/build/numba/numba/numba/lowering.py", li... | AssertionError |
def get_array_index_type(ary, idx):
"""
Returns None or a tuple-3 for the types of the input array, index, and
resulting type of ``array[index]``.
Note: This is shared logic for ndarray getitem and setitem.
"""
if not isinstance(ary, types.Buffer):
return
ndim = ary.ndim
left_... | def get_array_index_type(ary, idx):
"""
Returns None or a tuple-3 for the types of the input array, index, and
resulting type of ``array[index]``.
Note: This is shared logic for ndarray getitem and setitem.
"""
if not isinstance(ary, types.Buffer):
return
ndim = ary.ndim
left_... | https://github.com/numba/numba/issues/3225 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
~/miniconda3/envs/numba3/lib/python3.7/site-packages/numba/targets/base.py in cast(self, builder, val, fromty, toty)
674 try:
--> 675 impl = self._c... | NotImplementedError |
def _inline_const_arraycall(block, func_ir, context, typemap, calltypes):
"""Look for array(list) call where list is a constant list created by build_list,
and turn them into direct array creation and initialization, if the following
conditions are met:
1. The build_list call immediate preceeds the ar... | def _inline_const_arraycall(block, func_ir, context, typemap, calltypes):
"""Look for array(list) call where list is a constant list created by build_list,
and turn them into direct array creation and initialization, if the following
conditions are met:
1. The build_list call immediate preceeds the ar... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def inline_array(array_var, expr, stmts, list_vars, dels):
"""Check to see if the given "array_var" is created from a list
of constants, and try to inline the list definition as array
initialization.
Extra statements produced with be appended to "stmts".
"""
callname = guard(find_callname, func... | def inline_array(array_var, expr, stmts, list_vars, dels):
"""Check to see if the given "array_var" is created from a list
of constants, and try to inline the list definition as array
initialization.
Extra statements produced with be appended to "stmts".
"""
callname = guard(find_callname, func... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def _lower_parfor_parallel(lowerer, parfor):
from .parallel import get_thread_count
"""Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the ... | def _lower_parfor_parallel(lowerer, parfor):
"""Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The ... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def _create_shape_signature(
get_shape_classes,
num_inputs,
num_reductions,
args,
redargstartdim,
func_sig,
races,
typemap,
):
"""Create shape signature for GUFunc"""
if config.DEBUG_ARRAY_OPT:
print(
"_create_shape_signature", num_inputs, num_reductions, args... | def _create_shape_signature(
get_shape_classes, num_inputs, num_reductions, args, func_sig, races
):
"""Create shape signature for GUFunc"""
if config.DEBUG_ARRAY_OPT:
print("_create_shape_signature", num_inputs, num_reductions, args, func_sig)
for i in args[1:]:
print("argument"... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def _create_gufunc_for_parfor_body(
lowerer,
parfor,
typemap,
typingctx,
targetctx,
flags,
locals,
has_aliases,
index_var_typ,
races,
):
"""
Takes a parfor and creates a gufunc function for its body.
There are two parts to this function.
1) Code to iterate across ... | def _create_gufunc_for_parfor_body(
lowerer,
parfor,
typemap,
typingctx,
targetctx,
flags,
locals,
has_aliases,
index_var_typ,
races,
):
"""
Takes a parfor and creates a gufunc function for its body.
There are two parts to this function.
1) Code to iterate across ... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def call_parallel_gufunc(
lowerer,
cres,
gu_signature,
outer_sig,
expr_args,
expr_arg_types,
loop_ranges,
redvars,
reddict,
redarrdict,
init_block,
index_var_typ,
races,
):
"""
Adds the call to the gufunc function from the main function.
"""
context = ... | def call_parallel_gufunc(
lowerer,
cres,
gu_signature,
outer_sig,
expr_args,
loop_ranges,
redvars,
reddict,
init_block,
index_var_typ,
races,
):
"""
Adds the call to the gufunc function from the main function.
"""
context = lowerer.context
builder = lowere... | https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def get_shape_classes(self, var, typemap=None):
"""get the shape classes for a given variable.
If a typemap is specified then use it for type resolution
"""
# We get shape classes from the equivalence set but that
# keeps its own typemap at a time prior to lowering. So
# if something is added d... | def get_shape_classes(self, var):
return self.equiv_set.get_shape_classes(var)
| https://github.com/numba/numba/issues/3069 | Traceback (most recent call last):
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\errors.py", line 491, in new_error_context
yield
File "C:\Users\kittoku\Anaconda3\envs\test_env\lib\site-packages\numba\lowering.py", line 216, in lower_block
self.lower_inst(inst)
File "C:\Users\kittoku\Anaconda3\... | TypeError |
def strformat(self, nlines_up=2):
try:
# Try to get a relative path
# ipython/jupyter input just returns as self.filename
path = os.path.relpath(self.filename)
except ValueError:
# Fallback to absolute path if error occurred in getting the
# relative path.
# This ... | def strformat(self, nlines_up=2):
try:
# Try to get a relative path
# ipython/jupyter input just returns as self.filename
path = os.path.relpath(self.filename)
except ValueError:
# Fallback to absolute path if error occurred in getting the
# relative path.
# This ... | https://github.com/numba/numba/issues/3135 | $ conda create -n dsdebug python=3.6
[...]
The following NEW packages will be INSTALLED:
ca-certificates: 2018.03.07-0
certifi: 2018.4.16-py36_0
libcxx: 4.0.1-h579ed51_0
libcxxabi: 4.0.1-hebd6815_0
libedit: 3.1.20170329-hb402a30_2
libffi: 3.2.1-h475c297_4
ncurses: 6.1-h0... | IndexError |
def run(self):
"""Run inline closure call pass."""
modified = False
work_list = list(self.func_ir.blocks.items())
debug_print = _make_debug_print("InlineClosureCallPass")
debug_print("START")
while work_list:
label, block = work_list.pop()
for i, instr in enumerate(block.body):
... | def run(self):
"""Run inline closure call pass."""
modified = False
work_list = list(self.func_ir.blocks.items())
debug_print = _make_debug_print("InlineClosureCallPass")
debug_print("START")
while work_list:
label, block = work_list.pop()
for i, instr in enumerate(block.body):
... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def remove_dead(blocks, args, func_ir, typemap=None, alias_map=None, arg_aliases=None):
"""dead code elimination using liveness and CFG info.
Returns True if something has been removed, or False if nothing is removed.
"""
cfg = compute_cfg_from_blocks(blocks)
usedefs = compute_use_defs(blocks)
l... | def remove_dead(blocks, args, typemap=None, alias_map=None, arg_aliases=None):
"""dead code elimination using liveness and CFG info.
Returns True if something has been removed, or False if nothing is removed.
"""
cfg = compute_cfg_from_blocks(blocks)
usedefs = compute_use_defs(blocks)
live_map =... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def remove_dead_block(
block, lives, call_table, arg_aliases, alias_map, alias_set, func_ir, typemap
):
"""remove dead code using liveness info.
Mutable arguments (e.g. arrays) that are not definitely assigned are live
after return of function.
"""
# TODO: find mutable args that are not definite... | def remove_dead_block(
block, lives, call_table, arg_aliases, alias_map, alias_set, typemap
):
"""remove dead code using liveness info.
Mutable arguments (e.g. arrays) that are not definitely assigned are live
after return of function.
"""
# TODO: find mutable args that are not definitely assign... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def find_potential_aliases(
blocks, args, typemap, func_ir, alias_map=None, arg_aliases=None
):
"find all array aliases and argument aliases to avoid remove as dead"
if alias_map is None:
alias_map = {}
if arg_aliases is None:
arg_aliases = set(a for a in args if not is_immutable_type(a,... | def find_potential_aliases(blocks, args, typemap, alias_map=None, arg_aliases=None):
"find all array aliases and argument aliases to avoid remove as dead"
if alias_map is None:
alias_map = {}
if arg_aliases is None:
arg_aliases = set(a for a in args if not is_immutable_type(a, typemap))
... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def simplify(func_ir, typemap, calltypes):
remove_dels(func_ir.blocks)
# get copies in to blocks and out from blocks
in_cps, out_cps = copy_propagate(func_ir.blocks, typemap)
# table mapping variable names to ir.Var objects to help replacement
name_var_table = get_name_var_table(func_ir.blocks)
... | def simplify(func_ir, typemap, calltypes):
remove_dels(func_ir.blocks)
# get copies in to blocks and out from blocks
in_cps, out_cps = copy_propagate(func_ir.blocks, typemap)
# table mapping variable names to ir.Var objects to help replacement
name_var_table = get_name_var_table(func_ir.blocks)
... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def _lower_parfor_parallel(lowerer, parfor):
"""Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The ... | def _lower_parfor_parallel(lowerer, parfor):
"""Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
in the context of the current function.
2) The ... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def remove_dead_parfor(parfor, lives, arg_aliases, alias_map, func_ir, typemap):
"""remove dead code inside parfor including get/sets"""
with dummy_return_in_loop_body(parfor.loop_body):
labels = find_topo_order(parfor.loop_body)
# get/setitem replacement should ideally use dataflow to propagate s... | def remove_dead_parfor(parfor, lives, arg_aliases, alias_map, typemap):
"""remove dead code inside parfor including get/sets"""
with dummy_return_in_loop_body(parfor.loop_body):
labels = find_topo_order(parfor.loop_body)
# get/setitem replacement should ideally use dataflow to propagate setitem
... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def remove_dead_parfor_recursive(
parfor, lives, arg_aliases, alias_map, func_ir, typemap
):
"""create a dummy function from parfor and call remove dead recursively"""
blocks = parfor.loop_body.copy() # shallow copy is enough
first_body_block = min(blocks.keys())
assert first_body_block > 0 # we a... | def remove_dead_parfor_recursive(parfor, lives, arg_aliases, alias_map, typemap):
"""create a dummy function from parfor and call remove dead recursively"""
blocks = parfor.loop_body.copy() # shallow copy is enough
first_body_block = min(blocks.keys())
assert first_body_block > 0 # we are using 0 for ... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def find_potential_aliases_parfor(
parfor, args, typemap, func_ir, alias_map, arg_aliases
):
blocks = wrap_parfor_blocks(parfor)
ir_utils.find_potential_aliases(
blocks, args, typemap, func_ir, alias_map, arg_aliases
)
unwrap_parfor_blocks(parfor)
return
| def find_potential_aliases_parfor(parfor, args, typemap, alias_map, arg_aliases):
blocks = wrap_parfor_blocks(parfor)
ir_utils.find_potential_aliases(blocks, args, typemap, alias_map, arg_aliases)
unwrap_parfor_blocks(parfor)
return
| https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def build_parfor_definitions(parfor, definitions=None):
"""get variable definition table for parfors"""
if definitions is None:
definitions = defaultdict(list)
# avoid wrap_parfor_blocks() since build_definitions is called inside
# find_potential_aliases_parfor where the parfor is already wrapp... | def build_parfor_definitions(parfor, definitions=None):
"""get variable definition table for parfors"""
if definitions is None:
definitions = dict()
blocks = wrap_parfor_blocks(parfor)
build_definitions(blocks, definitions)
unwrap_parfor_blocks(parfor)
return definitions
| https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def run(self):
"""Finds all calls to StencilFuncs in the IR and converts them to parfor."""
from numba.stencil import StencilFunc
# Get all the calls in the function IR.
call_table, _ = get_call_table(self.func_ir.blocks)
stencil_calls = []
stencil_dict = {}
for call_varname, call_list in c... | def run(self):
"""Finds all calls to StencilFuncs in the IR and converts them to parfor."""
from numba.stencil import StencilFunc
# Get all the calls in the function IR.
call_table, _ = get_call_table(self.func_ir.blocks)
stencil_calls = []
stencil_dict = {}
for call_varname, call_list in c... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def _mk_stencil_parfor(
self,
label,
in_args,
out_arr,
stencil_ir,
index_offsets,
target,
return_type,
stencil_func,
arg_to_arr_dict,
):
"""Converts a set of stencil kernel blocks to a parfor."""
gen_nodes = []
stencil_blocks = stencil_ir.blocks
if config.DEBUG_A... | def _mk_stencil_parfor(
self,
label,
in_args,
out_arr,
stencil_blocks,
index_offsets,
target,
return_type,
stencil_func,
arg_to_arr_dict,
):
"""Converts a set of stencil kernel blocks to a parfor."""
gen_nodes = []
if config.DEBUG_ARRAY_OPT == 1:
print(
... | https://github.com/numba/numba/issues/2954 | Serial:
[ 0 1 2 3 4 15 16 17 18 19]
Parallel:
Parallel for-loop #0 is produced from pattern '('prange', 'user')' at <ipython-input-1-f9ca7dd40116> (18)
After fusion, function parallel has 1 parallel for-loop(s) #set([0]).
---------------------------------------------------------------------------
LoweringError ... | LoweringError |
def np_nanmedian(a):
if not isinstance(a, types.Array):
return
isnan = get_isnan(a.dtype)
def nanmedian_impl(arry):
# Create a temporary workspace with only non-NaN values
temp_arry = np.empty(arry.size, arry.dtype)
n = 0
for view in np.nditer(arry):
v = ... | def np_nanmedian(a):
if not isinstance(a, types.Array):
return
isnan = get_isnan(a.dtype)
def nanmedian_impl(arry):
# Create a temporary workspace with only non-NaN values
temp_arry = np.empty(arry.size, arry.dtype)
n = 0
for view in np.nditer(arry):
v = ... | https://github.com/numba/numba/issues/2617 | ---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-15-cb312ec8285d> in <module>()
8 a = np.array([np.nan])
9 print(np.nanmedian(a))
---> 10 print(f(np.array([np.nan, np.nan])))
AssertionError: | AssertionError |
def nanmedian_impl(arry):
# Create a temporary workspace with only non-NaN values
temp_arry = np.empty(arry.size, arry.dtype)
n = 0
for view in np.nditer(arry):
v = view.item()
if not isnan(v):
temp_arry[n] = v
n += 1
# all NaNs
if n == 0:
return ... | def nanmedian_impl(arry):
# Create a temporary workspace with only non-NaN values
temp_arry = np.empty(arry.size, arry.dtype)
n = 0
for view in np.nditer(arry):
v = view.item()
if not isnan(v):
temp_arry[n] = v
n += 1
return _median_inner(temp_arry, n)
| https://github.com/numba/numba/issues/2617 | ---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-15-cb312ec8285d> in <module>()
8 a = np.array([np.nan])
9 print(np.nanmedian(a))
---> 10 print(f(np.array([np.nan, np.nan])))
AssertionError: | AssertionError |
def replace_return_with_setitem(self, blocks, index_vars, out_name):
"""
Find return statements in the IR and replace them with a SetItem
call of the value "returned" by the kernel into the result array.
Returns the block labels that contained return statements.
"""
ret_blocks = []
for labe... | def replace_return_with_setitem(self, blocks, index_vars, out_name):
"""
Find return statements in the IR and replace them with a SetItem
call of the value "returned" by the kernel into the result array.
"""
for block in blocks.values():
scope = block.scope
loc = block.loc
ne... | https://github.com/numba/numba/issues/2603 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-24-95489a051be1> in <module>()
----> 1 kernel1(np.array([[1,2,3], [4,5,6], [7,8,9]]))
~/envs/py36/lib/python3.6/site-packages/numba/stencil.py in __call... | AttributeError |
def _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args):
# Overall approach:
# 1) Construct a string containing a function definition for the stencil function
# that will execute the stencil kernel. This function definition includes a
# unique stencil function name, the... | def _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args):
# Overall approach:
# 1) Construct a string containing a function definition for the stencil function
# that will execute the stencil kernel. This function definition includes a
# unique stencil function name, the... | https://github.com/numba/numba/issues/2603 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-24-95489a051be1> in <module>()
----> 1 kernel1(np.array([[1,2,3], [4,5,6], [7,8,9]]))
~/envs/py36/lib/python3.6/site-packages/numba/stencil.py in __call... | AttributeError |
def _mk_stencil_parfor(
self,
label,
in_args,
out_arr,
stencil_blocks,
index_offsets,
target,
return_type,
stencil_func,
arg_to_arr_dict,
):
"""Converts a set of stencil kernel blocks to a parfor."""
gen_nodes = []
if config.DEBUG_ARRAY_OPT == 1:
print(
... | def _mk_stencil_parfor(
self,
label,
in_args,
out_arr,
stencil_blocks,
index_offsets,
target,
return_type,
stencil_func,
arg_to_arr_dict,
):
"""Converts a set of stencil kernel blocks to a parfor."""
gen_nodes = []
if config.DEBUG_ARRAY_OPT == 1:
print(
... | https://github.com/numba/numba/issues/2603 | ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-24-95489a051be1> in <module>()
----> 1 kernel1(np.array([[1,2,3], [4,5,6], [7,8,9]]))
~/envs/py36/lib/python3.6/site-packages/numba/stencil.py in __call... | AttributeError |
def _extract_loop_lifting_candidates(cfg, blocks):
"""
Returns a list of loops that are candidate for loop lifting
"""
# check well-formed-ness of the loop
def same_exit_point(loop):
"all exits must point to the same location"
outedges = set()
for k in loop.exits:
... | def _extract_loop_lifting_candidates(cfg, blocks):
"""
Returns a list of loops that are candidate for loop lifting
"""
# check well-formed-ness of the loop
def same_exit_point(loop):
"all exits must point to the same location"
outedges = set()
for k in loop.exits:
... | https://github.com/numba/numba/issues/2561 | Traceback (most recent call last):
File "numbabug.py", line 11, in <module>
numbafunc([])
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 307, in _compile_for_args
return self.compile(tuple(argtypes))
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 579, ... | ValueError |
def same_exit_point(loop):
"all exits must point to the same location"
outedges = set()
for k in loop.exits:
succs = set(x for x, _ in cfg.successors(k))
if not succs:
# If the exit point has no successor, it contains an return
# statement, which is not handled by the... | def same_exit_point(loop):
"all exits must point to the same location"
outedges = set()
for k in loop.exits:
outedges |= set(x for x, _ in cfg.successors(k))
return len(outedges) == 1
| https://github.com/numba/numba/issues/2561 | Traceback (most recent call last):
File "numbabug.py", line 11, in <module>
numbafunc([])
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 307, in _compile_for_args
return self.compile(tuple(argtypes))
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 579, ... | ValueError |
def _loop_lift_get_candidate_infos(cfg, blocks, livemap):
"""
Returns information on looplifting candidates.
"""
loops = _extract_loop_lifting_candidates(cfg, blocks)
loopinfos = []
for loop in loops:
[callfrom] = loop.entries # requirement checked earlier
# This loop exists to ... | def _loop_lift_get_candidate_infos(cfg, blocks, livemap):
"""
Returns information on looplifting candidates.
"""
loops = _extract_loop_lifting_candidates(cfg, blocks)
loopinfos = []
for loop in loops:
[callfrom] = loop.entries # requirement checked earlier
an_exit = next(iter(lo... | https://github.com/numba/numba/issues/2561 | Traceback (most recent call last):
File "numbabug.py", line 11, in <module>
numbafunc([])
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 307, in _compile_for_args
return self.compile(tuple(argtypes))
File "/home/tuukka/.local/lib/python3.5/site-packages/numba/dispatcher.py", line 579, ... | ValueError |
def __init__(self, typingctx, targetctx, library, args, return_type, flags, locals):
# Make sure the environment is reloaded
config.reload_config()
typingctx.refresh()
targetctx.refresh()
self.typingctx = typingctx
self.targetctx = _make_subtarget(targetctx, flags)
self.library = library
... | def __init__(self, typingctx, targetctx, library, args, return_type, flags, locals):
# Make sure the environment is reloaded
config.reload_config()
typingctx.refresh()
targetctx.refresh()
self.typingctx = typingctx
self.targetctx = _make_subtarget(targetctx, flags)
self.library = library
... | https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def stage_objectmode_frontend(self):
"""
Front-end: Analyze bytecode, generate Numba IR, infer types
"""
self.func_ir = self.func_ir_original or self.func_ir
if self.flags.enable_looplift:
assert not self.lifted
cres = self.frontend_looplift()
if cres is not None:
... | def stage_objectmode_frontend(self):
"""
Front-end: Analyze bytecode, generate Numba IR, infer types
"""
if self.flags.enable_looplift:
assert not self.lifted
cres = self.frontend_looplift()
if cres is not None:
raise _EarlyPipelineCompletion(cres)
# Fallback typ... | https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def _compile_core(self):
"""
Populate and run compiler pipeline
"""
pm = _PipelineManager()
if not self.flags.force_pyobject:
pm.create_pipeline("nopython")
if self.func_ir is None:
pm.add_stage(self.stage_analyze_bytecode, "analyzing bytecode")
pm.add_stage(self... | def _compile_core(self):
"""
Populate and run compiler pipeline
"""
pm = _PipelineManager()
if not self.flags.force_pyobject:
pm.create_pipeline("nopython")
if self.func_ir is None:
pm.add_stage(self.stage_analyze_bytecode, "analyzing bytecode")
pm.add_stage(self... | https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def copy(self):
new_ir = copy.copy(self)
new_ir.blocks = self.blocks.copy()
return new_ir
| def copy(self):
block = Block(self.scope, self.loc)
block.body = self.body[:]
return block
| https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def match(self, interp, block, typemap, calltypes):
self.getitems = getitems = {}
self.block = block
# Detect all getitem expressions and find which ones can be
# rewritten
for expr in block.find_exprs(op="getitem"):
if expr.op == "getitem":
try:
const = interp.in... | def match(self, interp, block, typemap, calltypes):
self.getitems = getitems = []
self.block = block
# Detect all getitem expressions and find which ones can be
# rewritten
for expr in block.find_exprs(op="getitem"):
if expr.op == "getitem":
try:
const = interp.in... | https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def apply(self):
"""
Rewrite all matching getitems as static_getitems.
"""
new_block = self.block.copy()
new_block.clear()
for inst in self.block.body:
if isinstance(inst, ir.Assign):
expr = inst.value
if expr in self.getitems:
const = self.getitem... | def apply(self):
"""
Rewrite all matching getitems as static_getitems.
"""
for expr, const in self.getitems:
expr.op = "static_getitem"
expr.index_var = expr.index
expr.index = const
return self.block
| https://github.com/numba/numba/issues/2169 | ---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/Applications/anaconda/envs/numba029/lib/python3.5/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs)
242 try:
--> 243 yield
244 ... | NotImplementedError |
def create_stream(self):
handle = drvapi.cu_stream()
driver.cuStreamCreate(byref(handle), 0)
return Stream(
weakref.proxy(self), handle, _stream_finalizer(self.deallocations, handle)
)
| def create_stream(self):
handle = drvapi.cu_stream()
driver.cuStreamCreate(byref(handle), 0)
return Stream(
weakref.proxy(self), handle, _stream_finalizer(self.allocations, handle)
)
| https://github.com/numba/numba/issues/2064 | test_pinned (numba.cuda.tests.cudadrv.test_pinned.TestPinned) ... Exception ignored in: <finalize object at 0x7f75a9726260; dead>
Traceback (most recent call last):
File "/home/antoine/numba/numba/utils.py", line 593, in __call__
return info.func(*info.args, **(info.kwargs or {}))
File "/home/antoine/numba/numba/cuda/c... | AttributeError |
def _module_finalizer(context, handle):
trashing = context.trashing
modules = context.modules
def core():
def cleanup():
# All modules are owned by their parent Context.
# A Module is either released by a call to
# Context.unload_module, which clear the handle (p... | def _module_finalizer(context, handle):
trashing = context.trashing
modules = context.modules
def core():
def cleanup():
if modules:
del modules[handle.value]
driver.cuModuleUnload(handle)
trashing.add_trash(cleanup)
return core
| https://github.com/numba/numba/issues/1858 | ======================================================================
ERROR: test_cuda_driver_occupancy (numba.cuda.tests.cudadrv.test_cuda_driver.TestCudaDriver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudadrv... | KeyError |
def core():
def cleanup():
# All modules are owned by their parent Context.
# A Module is either released by a call to
# Context.unload_module, which clear the handle (pointer) mapping
# (checked by the following assertion), or, by Context.reset().
# Both releases the sole re... | def core():
def cleanup():
if modules:
del modules[handle.value]
driver.cuModuleUnload(handle)
trashing.add_trash(cleanup)
| https://github.com/numba/numba/issues/1858 | ======================================================================
ERROR: test_cuda_driver_occupancy (numba.cuda.tests.cudadrv.test_cuda_driver.TestCudaDriver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudadrv... | KeyError |
def cleanup():
# All modules are owned by their parent Context.
# A Module is either released by a call to
# Context.unload_module, which clear the handle (pointer) mapping
# (checked by the following assertion), or, by Context.reset().
# Both releases the sole reference to the Module and trigger th... | def cleanup():
if modules:
del modules[handle.value]
driver.cuModuleUnload(handle)
| https://github.com/numba/numba/issues/1858 | ======================================================================
ERROR: test_cuda_driver_occupancy (numba.cuda.tests.cudadrv.test_cuda_driver.TestCudaDriver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudadrv... | KeyError |
def __init__(self, context, handle, info_log, finalizer=None):
self.context = context
self.handle = handle
self.info_log = info_log
self.finalizer = finalizer
if self.finalizer is not None:
self._finalizer = utils.finalize(self, finalizer)
| def __init__(self, context, handle, info_log, finalizer=None):
self.context = context
self.handle = handle
self.info_log = info_log
self.finalizer = finalizer
self.is_managed = self.finalizer is not None
| https://github.com/numba/numba/issues/1858 | ======================================================================
ERROR: test_cuda_driver_occupancy (numba.cuda.tests.cudadrv.test_cuda_driver.TestCudaDriver)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudadrv... | KeyError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.