New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
numba vectorize returning list/array #3101
Comments
If my code is wrong, please correct it, otherwise make a request Found this linked and will cross-link import numpy as np
import time
import pdb
from numba import vectorize
@vectorize(['float32(float32, float32)'], target='parallel')
def VectorPowv(a, b):
x = a ** b
y = a * b
out = []
out.append(x)
out.append(y)
return out
def main():
N = 20000000
A = B = np.array(np.random.sample(N), dtype=np.float32)
A = A[:,np.newaxis]
B = B[:,np.newaxis]
pdb.set_trace()
start = time.time()
C = VectorPowv(A, B)
print("C[:5] = " + str(C[:5]))
print("C[-5:] = " + str(C[-5:]))
vector_add_time = time.time() - start
print("VectorPow took for % seconds" % vector_add_time)
if __name__=='__main__':
main()
Tracebackdtypenums.append(np.dtype(signature.return_type.name).num)
TypeError: data type "pyobject" not understood |
Thanks for the report. What is mentioned on the mailing list is correct. If you want to mutate a number of arrays at once then perhaps try a |
It is working with guvectorize, but I would have wanted this to work with vectorize. |
Feature request
Reporting a bug
the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
The text was updated successfully, but these errors were encountered: