Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. from numba import vectorize
  2.  
  3. @vectorize(['float64(float64, float64, UniTuple(float64, 9))'], target='cuda')
  4. def fn_vec(E, L, fparams):
  5. # calculations...
  6. return result
  7.  
  8. TypeError: data type "(float64 x 9)" not understood
  9.  
  10. nb.types.containers.UniTuple(nb.types.float64, 9)
  11.  
  12. import numba as nb
  13.  
  14. @nb.njit(
  15. nb.types.float64(
  16. nb.types.float64,
  17. nb.types.float64,
  18. nb.types.containers.UniTuple(nb.types.float64, 9)))
  19. def func(f1, f2, ftuple):
  20. # ...
  21. return f1
  22.  
  23. >>> nb.typeof((1.0, ) * 9)
  24. tuple(float64 x 9)
  25.  
  26. >>> type(nb.typeof((1.0, ) * 9))
  27. numba.types.containers.UniTuple
  28.  
  29. >>> help(type(nb.typeof((1.0, ) * 9))) # I shortened the result:
  30. Help on class UniTuple in module numba.types.containers:
  31.  
  32. class UniTuple(BaseAnonymousTuple, _HomogeneousTuple, numba.types.abstract.Sequence)
  33. | UniTuple(*args, **kwargs)
  34. |
  35. | Type class for homogeneous tuples.
  36. |
  37. | Methods defined here:
  38. |
  39. | __init__(self, dtype, count)
  40. | Initialize self. See help(type(self)) for accurate signature.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement