Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from numba import vectorize
- @vectorize(['float64(float64, float64, UniTuple(float64, 9))'], target='cuda')
- def fn_vec(E, L, fparams):
- # calculations...
- return result
- TypeError: data type "(float64 x 9)" not understood
- nb.types.containers.UniTuple(nb.types.float64, 9)
- import numba as nb
- @nb.njit(
- nb.types.float64(
- nb.types.float64,
- nb.types.float64,
- nb.types.containers.UniTuple(nb.types.float64, 9)))
- def func(f1, f2, ftuple):
- # ...
- return f1
- >>> nb.typeof((1.0, ) * 9)
- tuple(float64 x 9)
- >>> type(nb.typeof((1.0, ) * 9))
- numba.types.containers.UniTuple
- >>> help(type(nb.typeof((1.0, ) * 9))) # I shortened the result:
- Help on class UniTuple in module numba.types.containers:
- class UniTuple(BaseAnonymousTuple, _HomogeneousTuple, numba.types.abstract.Sequence)
- | UniTuple(*args, **kwargs)
- |
- | Type class for homogeneous tuples.
- |
- | Methods defined here:
- |
- | __init__(self, dtype, count)
- | Initialize self. See help(type(self)) for accurate signature.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement