Comments (1)
The default function type currently is "(double,) -> double". This default was a convenience inherited from the original vectorization use case, where you'd map a function over an arbitrary ndarray (of doubles, originally).
You can see this in the debug output:
>>> from numba.decorators import jit
>>> def f():
... return 3.0
...
>>> jit()(f)
. . .
define double @f(double) {
Entry:
ret double 3.000000e+00
}
. . .
So the workaround is to set arg_types
to an empty container:
>>> jit(arg_types=[])(f)
. . .
define double @f() {
Entry:
ret double 3.000000e+00
}
If there is enough outcry about this assumption, we can change that for this entry point into the compiler. The devel branch has type inference, and shouldn't require explicit type declarations.
from numba.
Related Issues (20)
- NumPy 2.0 incompatibility - A use of `np.complex_` still remains
- NumPy 2.0 incompatibility: RNG's `__getstate__()` returns `None`
- Specialized CUDA kernels lose a reference to the cache
- using rtsys in objmode incur pickle issue HOT 8
- nb.optional doesn't work with nb.types.NamedTuple HOT 5
- Caching is useless on higher order functions
- Code, which is never executed, slows down everything by factor 3 HOT 6
- jit wrapped numpy sort & unique is more than 5x slower HOT 9
- Failure in `test_TestPrangeSpecific` HOT 2
- Numba 0.60.0 Checklist HOT 1
- Inverting matrices with large condition numbers HOT 1
- unsupported keyword arguments and type inference unification limitation with `np.maximum` HOT 1
- numba HOT 1
- Omitted default argument not working HOT 2
- Hang up in if condition HOT 5
- lack of overflow check and incorrect type init when using jitclass HOT 1
- Tuples and inline = 'always' don't play together HOT 5
- `sign` with complex values does not match numpy 2.0 HOT 1
- AttributeError: 'Integer' object has no attribute 'literal_value' #115 HOT 8
- Can Numba use c++functions? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numba.