Array analysis error for constant float tuple creation
See original GitHub issueReporting a bug
- I have tried using the latest released version of Numba (most recent is visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
- I have included below a minimal working reproducer (if you are unsure how to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
Minimal example:
import numba
@numba.njit(parallel=True)
def f():
a = (1.2, 1.3)
return a[0]
f()
File "/Users/ehsan/dev/numba/numba/parfors/parfor.py", line 2708, in run
self._pre_run()
File "/Users/ehsan/dev/numba/numba/parfors/parfor.py", line 2700, in _pre_run
self.array_analysis.run(self.func_ir.blocks)
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 1119, in run
self._run_on_blocks(topo_order, blocks, cfg, init_equiv_set)
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 1139, in _run_on_blocks
pending_transforms = self._determine_transform(
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 1220, in _determine_transform
pre, post = self._analyze_inst(
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 1337, in _analyze_inst
needs_define = equiv_set.insert_equiv(lhs, shape)
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 518, in insert_equiv
obj_names = [self._get_names(x) for x in objs]
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 518, in <listcomp>
obj_names = [self._get_names(x) for x in objs]
File "/Users/ehsan/dev/numba/numba/parfors/array_analysis.py", line 431, in _get_names
raise NotImplementedError(
NotImplementedError: Failed in nopython mode pipeline (step: convert to parfors)
ShapeEquivSet does not support 1.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
I am try to assigne float numbers from tuple to numpy array
Looks like your numpy array is not of a float type. This means that your array can store only integers in this example....
Read more >Chapter 4. NumPy Basics: Arrays and Vectorized Computation
In complex computations, you may accrue some floating point error, making comparisons only valid up to a certain number of decimal places. Operations...
Read more >8. Lists and Tuples - Art of Problem Solving
Once Python has created a tuple in memory, it cannot be changed. ... The following list contains a string, a float, an integer,...
Read more >typing — Support for type hints — Python 3.11.1 documentation
T = TypeVar('T', int, float, complex) Vec = Iterable[tuple[T, ... For example, the static type checker did not report an error when assigning...
Read more >Supported Python features - Numba
It is currently unsupported to re-raise an exception created in compiled code. ... can only be used on tuples and constant lists of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I spoke to @ehsantn regarding this. I can’t speak to other possible usage, but our concern is simply that it doesn’t compile and not that we need to track tuples of floats. @stuartarchibald I assume this has been deprioritized, so I will make sure someone from Bodo picks up this issue.
@DrTodd13
Quite 😃 This is why I was considering whether this is useful or desirable, couldn’t come up with a use case for it but wasn’t sure if I was missing something.
This makes sense if there’s no conditions that exist for it. I think
ShapeEquivSet._get_names
needs to return()
in such cases, I can take a look. Thanks for the input.