Robert - 1 year ago 127

Python Question

I have an numpy one dimensional array c that is supposed to be filled with the contents of

`a + b`

`a + b`

`PyOpenCL`

I want to quickly determine the correctness of the result array

`c`

This is what I currently have

`def python_kernel(a, b, c):`

temp = a + b

if temp[:] != c[:]:

print "Error"

else:

print "Success!"

But I get the error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

But it seems

`a.any`

`a.all`

What should I do if I want to test if all of the scalers in the numpy array temp are equal to every value in the numpy array c?

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**